diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 11:22:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 12:03:22 +0300 |
commit | 4046f3a54dbaca65b83079a25ab008431b49890a (patch) | |
tree | bfa8fe83feef0252216e54231b52057d2ed6a106 /source/blender | |
parent | 5a029d7a6d80dccd9e56594314b8c6f5b802b095 (diff) |
Manipulator: use ui-scale for widgets
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/manipulators/intern/wm_manipulator.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c index 34b0af88f7a..6ba4d55e1e4 100644 --- a/source/blender/windowmanager/manipulators/intern/wm_manipulator.c +++ b/source/blender/windowmanager/manipulators/intern/wm_manipulator.c @@ -415,22 +415,24 @@ bool wm_manipulator_select(bContext *C, wmManipulatorMap *mmap, wmManipulator *m void wm_manipulator_calculate_scale(wmManipulator *mpr, const bContext *C) { const RegionView3D *rv3d = CTX_wm_region_view3d(C); - float scale = 1.0f; + float scale = U.ui_scale; if (mpr->parent_mgroup->type->flag & WM_MANIPULATORGROUPTYPE_SCALE_3D) { + scale *= U.manipulator_size; if (rv3d) { + /* 'ED_view3d_pixel_size' includes 'U.pixelsize', remove it. */ if (mpr->type->matrix_world_get) { float matrix_world[4][4]; mpr->type->matrix_world_get(mpr, matrix_world); - scale = ED_view3d_pixel_size(rv3d, matrix_world[3]) * (float)U.manipulator_size; + scale *= ED_view3d_pixel_size(rv3d, matrix_world[3]) / U.pixelsize; } else { - scale = ED_view3d_pixel_size(rv3d, mpr->matrix[3]) * (float)U.manipulator_size; + scale *= ED_view3d_pixel_size(rv3d, mpr->matrix[3]) / U.pixelsize; } } else { - scale = U.manipulator_size * 0.02f; + scale *= 0.02f; } } |