fix [#28197] Undoing Grease pencil removes last 2 strokes

This commit is contained in:
Campbell Barton 2011-08-09 20:33:35 +00:00
parent 4262bd2906
commit 3ddbc3869d

@ -1722,7 +1722,7 @@ static int gpencil_draw_modal (bContext *C, wmOperator *op, wmEvent *event)
/* standard undo/redo shouldn't be allowed to execute or else it causes crashes, so catch it here */
// FIXME: this is a hardcoded hotkey that can't be changed
// TODO: catch redo as well, but how?
if (event->type == ZKEY) {
if (event->type == ZKEY && event->val == KM_RELEASE) {
/* oskey = cmd key on macs as they seem to use cmd-z for undo as well? */
if ((event->ctrl) || (event->oskey)) {
/* just delete last stroke, which will look like undo to the end user */