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-11-21 21:25:13 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-21 21:31:20 +0300
commit0a3cf083641121765fc78277f00d89af6d2cfebc (patch)
tree7ffccf7abc783f9e43119c166fb15fafc9fd9b14 /source/blender/windowmanager/intern/wm_event_system.c
parente8b9ff78dcb5e8e4dcf8f3383f9e8c55a8533b17 (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_event_system.c')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 03a80ff240b..2a97ce8c904 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2612,8 +2612,9 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
if (wm_action_not_handled(action)) {
if (event->check_drag) {
wmWindow *win = CTX_wm_window(C);
- if ((abs(event->x - win->eventstate->prevclickx)) >= U.tweak_threshold ||
- (abs(event->y - win->eventstate->prevclicky)) >= U.tweak_threshold)
+ float tweak_threshold = U.tweak_threshold * U.dpi_fac;
+ if ((abs(event->x - win->eventstate->prevclickx)) >= tweak_threshold ||
+ (abs(event->y - win->eventstate->prevclicky)) >= tweak_threshold)
{
int x = event->x;
int y = event->y;