[Bf-extensions-cvs] [8f1363a8] master: BlenderKit: Prevent preview from drawing below UI region in 3d view
Vilem Duha
noreply at git.blender.org
Sun Apr 21 21:21:51 CEST 2019
Commit: 8f1363a8170bd33e8c66b16565afd31acd51dd64
Author: Vilem Duha
Date: Sat Apr 20 18:23:52 2019 +0200
Branches: master
https://developer.blender.org/rBA8f1363a8170bd33e8c66b16565afd31acd51dd64
BlenderKit: Prevent preview from drawing below UI region in 3d view
===================================================================
M blenderkit/ui.py
===================================================================
diff --git a/blenderkit/ui.py b/blenderkit/ui.py
index 66a3ffc6..63890950 100644
--- a/blenderkit/ui.py
+++ b/blenderkit/ui.py
@@ -328,7 +328,13 @@ def draw_tooltip(x, y, text, img):
y -= 2 * ttipmargin
width = isizex + 2 * ttipmargin
- x = min(x + width, region.width) - width
+
+ properties_width = 0
+ for r in bpy.context.area.regions:
+ if r.type == 'UI':
+ properties_width = r.width
+
+ x = min(x + width, region.width - properties_width) - width
bgcol = bpy.context.preferences.themes[0].user_interface.wcol_tooltip.inner
textcol = bpy.context.preferences.themes[0].user_interface.wcol_tooltip.text
@@ -1420,7 +1426,6 @@ def unregister_ui():
args = (None, bpy.context)
-
wm = bpy.context.window_manager
if not wm.keyconfigs.addon:
return
More information about the Bf-extensions-cvs
mailing list