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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-28 21:48:47 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-04-28 21:50:47 +0300
commitca7964c24b814182c0261d1c3f4ffeb6cfd799a7 (patch)
tree3c595b781c178c90cdc5b85ae8fbea9e05eea5a1 /release
parentb5d3fcc9f5c80c459cce2b895f3d6091a59d0571 (diff)
UI: fix toolbar not snapping properly with system DPI and display scale.
Diffstat (limited to 'release')
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_common.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 12e2f6c3fd8..6bbf311b520 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -299,12 +299,13 @@ class ToolSelectPanelHelper:
"""
# Currently this just checks the width,
# we could have different layouts as preferences too.
+ system = bpy.context.user_preferences.system
view2d = region.view2d
- ui_scale = (
+ view2d_scale = (
view2d.region_to_view(1.0, 0.0)[0] -
view2d.region_to_view(0.0, 0.0)[0]
)
- width_scale = region.width * ui_scale
+ width_scale = region.width * view2d_scale / system.ui_scale
if width_scale > 120.0:
show_text = True