From de7b8dd51bd9c8e0c491a22b042cedd80245969f Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Wed, 3 May 2023 10:11:56 -0700 Subject: [PATCH] After Ctrl+click pipette, color selector showed old color Was redrawing color toolbar _before_ changing the chosen color to be the pipette tool. Reproducing the bug - Select a built-in color, Ctrl+click in the canvas, observe built-in color still appears chosen [the bug], paint with e.g., paint brush, observe it's using the correct, pipette-selected color, not the one that appears chosen [this is correct]. --- docs/CHANGES.txt | 4 ++++ src/tuxpaint.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 0868697e4..00ec9e729 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -133,6 +133,10 @@ https://tuxpaint.org/ * Don't try to load a blank-named template during slideshow playback. Bill Kendrick + * Color palette would still show previously-selected color as active + when returning from the temporary color pipette ([Ctrl] + click). + Bill Kendrick + * Ports & Building: ----------------- * Created "src/indent.sh", to run 'indent' against source files. diff --git a/src/tuxpaint.c b/src/tuxpaint.c index c64165599..9d9d858d0 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - May 1, 2023 + June 14, 2002 - May 3, 2023 */ #include "platform.h" @@ -5203,7 +5203,6 @@ static void mainloop(void) chose_color = do_color_sel(1); draw_cur_tool_tip(); - draw_colors(COLORSEL_FORCE_REDRAW); if (chose_color) { @@ -5214,6 +5213,8 @@ static void mainloop(void) else playsound(screen, 1, SND_CLICK, 1, SNDPOS_CENTER, SNDDIST_NEAR); + draw_colors(COLORSEL_FORCE_REDRAW); + SDL_Flip(screen); } else if (kbd_state[SDL_SCANCODE_X])