diff options
author | Campbell Barton <campbell@blender.org> | 2022-02-24 14:48:34 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-02-25 09:58:22 +0300 |
commit | ad0b3abf539bbb358f799d3f36649b5d46f222c8 (patch) | |
tree | d7aff552c5541880ca1ce2648595455418cafc56 /source/blender/editors/gpencil/annotate_paint.c | |
parent | e7cae5187773f41e62830be597c6f598bff0653f (diff) |
Cleanup: use flags for wmEvent modifier keys
Using flags makes checking multiple modifiers at once more convenient
and avoids macros/functions such as IS_EVENT_MOD & WM_event_modifier_flag
which have been removed. It also simplifies checking if modifier keys
have changed.
Diffstat (limited to 'source/blender/editors/gpencil/annotate_paint.c')
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 163b5657326..b40dda146dc 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -2060,7 +2060,7 @@ static void annotation_draw_apply_event( p->mval[1] = (float)event->mval[1] - y; /* Key to toggle stabilization. */ - if (event->shift && p->paintmode == GP_PAINTMODE_DRAW) { + if ((event->modifier & KM_SHIFT) && (p->paintmode == GP_PAINTMODE_DRAW)) { /* Using permanent stabilization, shift will deactivate the flag. */ if (p->flags & GP_PAINTFLAG_USE_STABILIZER) { if (p->flags & GP_PAINTFLAG_USE_STABILIZER_TEMP) { @@ -2075,7 +2075,7 @@ static void annotation_draw_apply_event( } } /* verify key status for straight lines */ - else if (event->ctrl || event->alt) { + else if (event->modifier & (KM_CTRL | KM_ALT)) { if (p->straight[0] == 0) { int dx = abs((int)(p->mval[0] - p->mvalo[0])); int dy = abs((int)(p->mval[1] - p->mvalo[1])); @@ -2299,7 +2299,7 @@ static int annotation_draw_invoke(bContext *C, wmOperator *op, const wmEvent *ev p->flags |= GP_PAINTFLAG_USE_STABILIZER | GP_PAINTFLAG_USE_STABILIZER_TEMP; annotation_draw_toggle_stabilizer_cursor(p, true); } - else if (event->shift) { + else if (event->modifier & KM_SHIFT) { p->flags |= GP_PAINTFLAG_USE_STABILIZER_TEMP; annotation_draw_toggle_stabilizer_cursor(p, true); } |