Don't Magic switch-out & -in on pointless Ctrl-R/Z

h/t Pere for a correction for Ctrl-R (I also applied to Ctlr-Z)
and Miyagi for reporting the issue

Closes https://sourceforge.net/p/tuxpaint/bugs/294/
This commit is contained in:
Bill Kendrick 2024-10-23 20:55:13 -07:00
parent 53a108c8ce
commit c88616e13e
2 changed files with 16 additions and 10 deletions

View file

@ -6,7 +6,7 @@ Copyright (c) 2002-2024
Various contributors (see below, and AUTHORS.txt)
https://tuxpaint.org/
2024.October.21 (0.9.34)
2024.October.23 (0.9.34)
* New Magic Tools:
----------------
* "Comic Dots", draws repeating dots (using a multiply blend)
@ -221,6 +221,12 @@ https://tuxpaint.org/
transparent areas (e.g., soft edges would be black halos). Mended.
Bill Kendrick <bill@newbreedsoftware.com>
* Hitting [Ctrl]-[R] or [Ctrl]-[Z] would invoke switch-out
and switch-back-in of Magic tools, even when no action occured.
h/t Miyagi Andel for reporting
Pere Pujal i Carabantes <perepujal@gmail.com>
Closes https://sourceforge.net/p/tuxpaint/bugs/294/
* Other Improvements:
-------------------
* The macOS build now links against SDL2_gfx. Previously SDL2_gfx was

View file

@ -22,7 +22,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
June 14, 2002 - October 20, 2024
June 14, 2002 - October 23, 2024
*/
#include "platform.h"
@ -2892,10 +2892,10 @@ static void mainloop(void)
/* Ctrl-Z - Undo */
/* (As long as we're not in the middle of something!!!) */
magic_switchout(canvas);
if (tool_avail[TOOL_UNDO])
{
magic_switchout(canvas);
if (cursor_x != -1 && cursor_y != -1)
{
hide_blinking_cursor();
@ -2930,18 +2930,18 @@ static void mainloop(void)
update_screen_rect(&r_tools);
shape_tool_mode = SHAPE_TOOL_MODE_DONE;
maybe_redraw_eraser_xor();
}
magic_switchin(canvas);
magic_switchin(canvas);
}
}
else if (key == SDLK_r && (mod & KMOD_CTRL) && !noshortcuts)
{
/* Ctrl-R - Redo */
magic_switchout(canvas);
if (tool_avail[TOOL_REDO])
{
magic_switchout(canvas);
if (cur_tool == TOOL_STAMP)
reset_stamps(&stamp_xored_rt, &stamp_place_x, &stamp_place_y, &stamp_tool_mode);
hide_blinking_cursor();
@ -2949,9 +2949,9 @@ static void mainloop(void)
update_screen_rect(&r_tools);
shape_tool_mode = SHAPE_TOOL_MODE_DONE;
maybe_redraw_eraser_xor();
}
magic_switchin(canvas);
magic_switchin(canvas);
}
}
else if (key == SDLK_o && (mod & KMOD_CTRL) && !noshortcuts)
{