diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-10-27 11:01:46 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-10-27 16:24:52 +0300 |
commit | aea7e555221e071e65fe76eb9571198622bbc547 (patch) | |
tree | c63b01d327693cfa82a1d0b6ba3b7f675593df45 /source/blender/windowmanager/intern/wm_event_system.c | |
parent | 2a709c82c369a8b87592156bf1afc0222d44a778 (diff) |
WM: de-duplicate cursor motion checks for selection picking
Replace local static mouse coordinate storage with a single function.
also resolve inconsistencies.
- Edit-mesh selection used equality check (ignoring `U.move_threshold`).
- Motion to clear tooltips checked the value without scaling by the DPI.
Also prevent the unlikely case of the previous motion check matching
a different area by resetting the value when the active region changes.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 2aa9a4d8676..a426841b49c 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -3628,7 +3628,8 @@ void wm_event_do_handlers(bContext *C) /* Clear tool-tip on mouse move. */ if (screen->tool_tip && screen->tool_tip->exit_on_event) { if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) { - if (len_manhattan_v2v2_int(screen->tool_tip->event_xy, event->xy) > U.move_threshold) { + if (len_manhattan_v2v2_int(screen->tool_tip->event_xy, event->xy) > + WM_EVENT_CURSOR_MOTION_THRESHOLD) { WM_tooltip_clear(C, win); } } |