From 9bbdc6c93e246c4c478bbfbae9bb31b2feb98b9c Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Sat, 8 Jan 2005 08:09:38 +0000 Subject: [PATCH] Only re-render current text if font, style or size changes. (i.e., DON'T re-render if we're simply scrolling, or clicking buttons on the right that are currently inactive!) --- src/tuxpaint.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 72f642dd6..e2ceaea0a 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -3109,6 +3109,7 @@ static void mainloop(void) { text_size++; control_sound = SND_GROW; + toolopt_changed = 1; } } else @@ -3118,6 +3119,7 @@ static void mainloop(void) { text_size--; control_sound = SND_SHRINK; + toolopt_changed = 1; } } } @@ -3152,7 +3154,10 @@ static void mainloop(void) control_sound = SND_THICK; } } + toolopt_changed = 1; } + + if (control_sound != -1) { playsound(0, control_sound, 0); @@ -3244,7 +3249,10 @@ static void mainloop(void) if (do_draw) draw_fonts(); - do_render_cur_text(0); + + // Only rerender when picking a different font + if (toolopt_changed) + do_render_cur_text(0); } else if (cur_tool == TOOL_STAMP) {