Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVilém Duha <vilda.novak@gmail.com>2020-02-07 11:02:47 +0300
committerVilém Duha <vilda.novak@gmail.com>2020-02-07 11:02:47 +0300
commit43f46021b09fdf8fc56ab46e5d7346a398b33b3d (patch)
tree3697e20ddaa24f782b2ca4f035c010fb2487e101
parent538e48dd9121f8ca98cdeb2c8d4dd81bb70ece39 (diff)
BlenderKit: hotfix - Yesterday's commit broke assetbar code
accidentally had unfinished asset bar code fix (which improves mouse_in_assetbar function)
-rw-r--r--blenderkit/ui.py6
1 files changed, 4 insertions, 2 deletions
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