From f02459af8721fe8c6c4f14f00c182aa53c347bc8 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Wed, 28 Sep 2022 01:17:08 -0700 Subject: [PATCH] [Del] quick eraser: avoid conflict; record undo buffer --- src/tuxpaint.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index a180936bf..b3dc71ca0 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -5365,8 +5365,15 @@ static void mainloop(void) } else if (kbd_state[SDL_SCANCODE_DELETE] /* FIXME */) { - /* Holding [Del] while clicking; switch to temp-mode eraser! */ - do_quick_eraser(); + /* Holding [Del] while clicking; switch to temp-mode eraser! + (as long as we're not involved in anything else within + this main loop!) */ + + if ((cur_tool != TOOL_SHAPES || shape_mode == SHAPE_TOOL_MODE_DONE) && + (cur_tool != TOOL_STAMP || stamp_tool_mode == STAMP_TOOL_MODE_PLACE)) + { + do_quick_eraser(); + } } else { @@ -24346,6 +24353,8 @@ static int do_quick_eraser(void) { old_eraser = cur_eraser; cur_eraser = NUM_ERASERS - 2; /* 2nd-smallest circle */ + rec_undo_buffer(); + done = 0; do {