[Bf-blender-cvs] [68c7553dd9a] blender2.8: Fix gizmos not using same tweak threshold as other places.
Brecht Van Lommel
noreply at git.blender.org
Mon Nov 26 13:57:52 CET 2018
Commit: 68c7553dd9a719a913370dbb2611695fcf7ff3fa
Author: Brecht Van Lommel
Date: Mon Nov 26 13:46:20 2018 +0100
Branches: blender2.8
https://developer.blender.org/rB68c7553dd9a719a913370dbb2611695fcf7ff3fa
Fix gizmos not using same tweak threshold as other places.
The low hardcoded threshold made clicking on the navigation gizmo difficult
on tablets.
===================================================================
M source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c
===================================================================
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;
}
More information about the Bf-blender-cvs
mailing list