diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-21 21:25:13 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-21 21:31:20 +0300 |
commit | 0a3cf083641121765fc78277f00d89af6d2cfebc (patch) | |
tree | 7ffccf7abc783f9e43119c166fb15fafc9fd9b14 /source/blender/windowmanager/intern/wm_gesture.c | |
parent | e8b9ff78dcb5e8e4dcf8f3383f9e8c55a8533b17 (diff) |
Keymaps: take into account DPI for tweak/drag/pie thresholds.
The intention is to fix a too low default threshold on high DPI screen.
Users with high DPI screens that have increased the threshold to fix this
or liked the lower threshold will need to lower it again.
This is still somewhat of a guess, ideally this would be based on the
physical distance travalled, and maybe different per type of input device.
However we do not have access to this information, and hope this gives a
better default.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_gesture.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_gesture.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_gesture.c b/source/blender/windowmanager/intern/wm_gesture.c index 06a7f3528c5..70150e40142 100644 --- a/source/blender/windowmanager/intern/wm_gesture.c +++ b/source/blender/windowmanager/intern/wm_gesture.c @@ -130,7 +130,8 @@ int wm_gesture_evaluate(wmGesture *gesture) rcti *rect = gesture->customdata; int dx = BLI_rcti_size_x(rect); int dy = BLI_rcti_size_y(rect); - if (abs(dx) + abs(dy) > U.tweak_threshold) { + float tweak_threshold = U.tweak_threshold * U.dpi_fac; + if (abs(dx) + abs(dy) > tweak_threshold) { int theta = round_fl_to_int(4.0f * atan2f((float)dy, (float)dx) / (float)M_PI); int val = EVT_GESTURE_W; |