diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-19 18:48:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-19 18:52:55 +0300 |
commit | 57395061042fe336dae7ee33e3ae11e53d068194 (patch) | |
tree | 02ea901d9229e417647ecb39b3f7d04df2ef01ce /source/blender/editors/screen/screen_ops.c | |
parent | bd803939957555e9c22b096365238704f55f6b3e (diff) |
UI: scale cursor motion threshold by DPI
This was using hard coded values of 2-3px.
Move both drag and motion thresholds to defines.
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index bb56d127b31..b4dfcf9ab66 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2511,8 +2511,7 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event) } case LEFTMOUSE: if (event->val == KM_RELEASE) { - - if (ABS(event->x - rmd->origx) < 2 && ABS(event->y - rmd->origy) < 2) { + if (len_manhattan_v2v2_int(&event->x, &rmd->origx) < WM_EVENT_CURSOR_MOTION_THRESHOLD) { if (rmd->ar->flag & RGN_FLAG_HIDDEN) { region_scale_toggle_hidden(C, rmd); } |