diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-26 15:46:20 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-11-26 15:46:44 +0300 |
commit | 68c7553dd9a719a913370dbb2611695fcf7ff3fa (patch) | |
tree | 0466af315f12b764f55bc75deadda85bab1d5e7e /source/blender/windowmanager/gizmo | |
parent | 18103c9ec260dc6570a81c37f83cf4a9c461a32a (diff) |
Fix gizmos not using same tweak threshold as other places.
The low hardcoded threshold made clicking on the navigation gizmo difficult
on tablets.
Diffstat (limited to 'source/blender/windowmanager/gizmo')
-rw-r--r-- | source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index 517f92491f0..67b7149c0bd 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -67,6 +67,7 @@ /* Allow gizmo part's to be single click only, * dragging falls back to activating their 'drag_part' action. */ #define USE_DRAG_DETECT +#define DRAG_THRESHOLD (U.tweak_threshold * U.dpi_fac) /* -------------------------------------------------------------------- */ /** \name wmGizmoGroup @@ -445,7 +446,7 @@ static int gizmo_tweak_modal(bContext *C, wmOperator *op, const wmEvent *event) wmGizmoMap *gzmap = mtweak->gzmap; if (mtweak->drag_state == DRAG_DETECT) { if (ELEM(event->type, MOUSEMOVE, INBETWEEN_MOUSEMOVE)) { - if (len_manhattan_v2v2_int(&event->x, gzmap->gzmap_context.event_xy) > 2) { + if (len_manhattan_v2v2_int(&event->x, gzmap->gzmap_context.event_xy) >= DRAG_THRESHOLD) { mtweak->drag_state = DRAG_IDLE; gz->highlight_part = gz->drag_part; } |