[Bf-extensions-cvs] [43f46021] blender-v2.82-release: BlenderKit: hotfix - Yesterday's commit broke assetbar code
Vilém Duha
noreply at git.blender.org
Fri Feb 7 22:38:58 CET 2020
Commit: 43f46021b09fdf8fc56ab46e5d7346a398b33b3d
Author: Vilém Duha
Date: Fri Feb 7 09:02:47 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBA43f46021b09fdf8fc56ab46e5d7346a398b33b3d
BlenderKit: hotfix - Yesterday's commit broke assetbar code
accidentally had unfinished asset bar code fix (which improves mouse_in_assetbar function)
===================================================================
M blenderkit/ui.py
===================================================================
diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index e51d17ea..f05012aa 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -1117,14 +1117,16 @@ def mouse_in_asset_bar(mx, my):
s = bpy.context.scene
ui_props = bpy.context.scene.blenderkitUI
+ search_results = s.get('search results')
+ if search_results == None:
+ return False
w_draw1 = min(ui_props.wcount + 1, len(search_results) - b * ui_props.wcount - ui_props.scrolloffset)
end = ui_props.bar_x + (w_draw1) * (
ui_props.margin + ui_props.thumb_size) + ui_props.margin + ui_props.drawoffset + 25
- ui_bgl.draw_rect(end, ui_props.bar_y, 50, 50, highlight)
if ui_props.bar_y - ui_props.bar_height < my < ui_props.bar_y \
- and mx > ui_props.bar_x and mx < ui_props.bar_x + ui_props.bar_width:
+ and mx > ui_props.bar_x and mx < end:
return True
else:
return False
More information about the Bf-extensions-cvs
mailing list