mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix snap gizmo flickering while dragging
Ignore click-drag for non-mouse button drag events Alternative to fix issue detailed in D10886.
This commit is contained in:
parent
2f367db2cc
commit
1534da457e
4 changed files with 8 additions and 2 deletions
|
|
@ -861,6 +861,7 @@ int WM_event_modifier_flag(const struct wmEvent *event);
|
|||
|
||||
bool WM_event_is_modal_tweak_exit(const struct wmEvent *event, int tweak_event);
|
||||
bool WM_event_is_last_mousemove(const struct wmEvent *event);
|
||||
bool WM_event_is_mouse_drag(const struct wmEvent *event);
|
||||
|
||||
int WM_event_drag_threshold(const struct wmEvent *event);
|
||||
bool WM_event_drag_test(const struct wmEvent *event, const int prev_xy[2]);
|
||||
|
|
|
|||
|
|
@ -592,7 +592,7 @@ static int gizmo_tweak_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
const int highlight_part_init = gz->highlight_part;
|
||||
|
||||
if (gz->drag_part != -1) {
|
||||
if (ISTWEAK(event->type) || (event->val == KM_CLICK_DRAG)) {
|
||||
if (WM_event_is_mouse_drag(event)) {
|
||||
gz->highlight_part = gz->drag_part;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -735,7 +735,7 @@ wmGizmo *wm_gizmomap_highlight_find(wmGizmoMap *gzmap,
|
|||
|
||||
/* Ensure for drag events we use the location where the user clicked.
|
||||
* Without this click-dragging on a gizmo can accidentally act on the wrong gizmo. */
|
||||
if (ISTWEAK(event->type) || (event->val == KM_CLICK_DRAG)) {
|
||||
if (WM_event_is_mouse_drag(event)) {
|
||||
mval[0] += event->x - event->prevclickx;
|
||||
mval[1] += event->y - event->prevclicky;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -265,6 +265,11 @@ bool WM_event_is_last_mousemove(const wmEvent *event)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool WM_event_is_mouse_drag(const wmEvent *event)
|
||||
{
|
||||
return ISTWEAK(event->type) || (ISMOUSE_BUTTON(event->type) && (event->val == KM_CLICK_DRAG));
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue