BlenderKit: Prevent preview from drawing below UI region in 3d view

This commit is contained in:
Vilem Duha 2019-04-20 18:23:52 +02:00
parent 0ea7694caf
commit 8f1363a817
1 changed files with 7 additions and 2 deletions

View File

@ -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