diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2019-08-10 11:44:44 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2019-08-10 17:04:42 +0300 |
commit | b99c616b9bd6218e18c6ecf13558b4a2a756d294 (patch) | |
tree | 8293ff19371686cb5f608d3b326b9a3b8afb40c8 /source/blender/editors/gpencil | |
parent | b91643c7113554f8cc2c50b9a988b5104bd6821f (diff) |
Fix T68414: GPencil crash after using L key and Ctrl+Z in Draw Mode
There is a segment fault because the operator was in modal but the Ctrl+Z breaks the custom data. Now, the Ctrl+Z ends the operator.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 06ff0e744b9..894fb6eced4 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -3460,12 +3460,18 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) /* We don't pass on key events, GP is used with key-modifiers - * prevents Dkey to insert drivers. */ if (ISKEYBOARD(event->type)) { - if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY, ZKEY)) { + if (ELEM(event->type, LEFTARROWKEY, DOWNARROWKEY, RIGHTARROWKEY, UPARROWKEY)) { /* allow some keys: * - for frame changing [#33412] * - for undo (during sketching sessions) */ } + else if (event->type == ZKEY) { + if (event->ctrl) { + p->status = GP_STATUS_DONE; + estate = OPERATOR_FINISHED; + } + } else if (ELEM(event->type, PAD0, PAD1, PAD2, PAD3, PAD4, PAD5, PAD6, PAD7, PAD8, PAD9)) { /* allow numpad keys so that camera/view manipulations can still take place * - PAD0 in particular is really important for Grease Pencil drawing, |