From 35dbd40bf61575880ad498a6f43fbebccb872501 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Tue, 3 Jan 2023 22:30:45 -0800 Subject: [PATCH] Disallow Ctrl-Z in certain situations Closes https://sourceforge.net/p/tuxpaint/bugs/239/ --- docs/CHANGES.txt | 9 +++++++-- src/tuxpaint.c | 7 ++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index b81380828..b559ae8c5 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -2,12 +2,12 @@ CHANGES.txt for Tux Paint Tux Paint - A simple drawing program for children. -Copyright (c) 2002-2022 +Copyright (c) 2002-2023 Various contributors (see below, and AUTHORS.txt) https://tuxpaint.org/ -2022.December.28 (0.9.29) +2022.January.3 (0.9.29) * Improvements to "Stamp" tool: ----------------------------- * Stamps may now be rotated. @@ -116,6 +116,11 @@ https://tuxpaint.org/ (h/t Miyagi Andel for reporting & Shin-ichi TOYAMA for pinpointing the issue) + * Disallow using Ctrl-Z shortcut while drawing or rotating shapes + or shapes, to avoid unexpected results. + Closes https://sourceforge.net/p/tuxpaint/bugs/239/ + Pere Pujal i Carabantes + * Ports & Building: ----------------- * Processed PNG images through `pngout` to increase some compression diff --git a/src/tuxpaint.c b/src/tuxpaint.c index df5045ba3..75dcebfcd 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -3,7 +3,7 @@ Tux Paint - A simple drawing program for children. - Copyright (c) 2002-2022 + Copyright (c) 2002-2023 by various contributors; see AUTHORS.txt https://tuxpaint.org/ @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - December 28, 2022 + June 14, 2002 - January 3, 2023 */ #include "platform.h" @@ -2861,9 +2861,10 @@ static void mainloop(void) magic_switchin(canvas); } #endif - else if (key == SDLK_z && (mod & KMOD_CTRL) && !noshortcuts) + else if (key == SDLK_z && (mod & KMOD_CTRL) && !noshortcuts && !button_down && !emulate_button_pressed && stamp_tool_mode != STAMP_TOOL_MODE_ROTATE && shape_tool_mode != SHAPE_TOOL_MODE_ROTATE) { /* Ctrl-Z - Undo */ + /* (As long as we're not in the middle of something!!!) */ magic_switchout(canvas);