diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-12 13:12:24 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-12 13:29:14 +0300 |
commit | f6b73966101db0fef10abd7b3a18e4a1ca120013 (patch) | |
tree | c51cabe2b1881e2075a61865c541a28ce316551c /source/blender/editors/transform | |
parent | a2bb3c4cadceed828011e3141a20cec45726292f (diff) |
Fix transform gizmo check for shift to constrain to a plane
The eventstate was checked instead of the current event being handled,
causing the check to be invalid in some cases.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_gizmo_3d.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c index f07fadb7fc1..5381785091a 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.c +++ b/source/blender/editors/transform/transform_gizmo_3d.c @@ -1824,7 +1824,7 @@ static void WIDGETGROUP_gizmo_draw_prepare(const bContext *C, wmGizmoGroup *gzgr static void WIDGETGROUP_gizmo_invoke_prepare(const bContext *C, wmGizmoGroup *gzgroup, wmGizmo *gz, - const wmEvent *UNUSED(event)) + const wmEvent *event) { GizmoGroup *ggd = gzgroup->customdata; @@ -1867,9 +1867,8 @@ static void WIDGETGROUP_gizmo_invoke_prepare(const bContext *C, } if (axis != -1) { - wmWindow *win = CTX_wm_window(C); /* Swap single axis for two-axis constraint. */ - bool flip = (win->eventstate->modifier & KM_SHIFT) != 0; + const bool flip = (event->modifier & KM_SHIFT) != 0; BLI_assert(axis_idx != -1); const short axis_type = gizmo_get_axis_type(axis_idx); if (axis_type != MAN_AXES_ROTATE) { |