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 /source/blender/editors/space_view3d
parentb5d3fcc9f5c80c459cce2b895f3d6091a59d0571 (diff)
UI: fix toolbar not snapping properly with system DPI and display scale.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index c219da36faf..d1b352d56f9 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -75,6 +75,7 @@
#include "RNA_access.h"
+#include "UI_interface.h"
#include "UI_resources.h"
#ifdef WITH_PYTHON
@@ -1273,7 +1274,7 @@ static int view3d_tools_region_snap_size(const ARegion *ar, int size, int axis)
int best_diff = INT_MAX;
int best_size = size;
for (uint i = 0; i < ARRAY_SIZE(snap_units); i += 1) {
- const int test_size = (snap_units[i] * U.widget_unit) / aspect;
+ const int test_size = (snap_units[i] * U.widget_unit) / (UI_DPI_FAC * aspect);
const int test_diff = ABS(test_size - size);
if (test_diff < best_diff) {
best_size = test_size;