From 73eef80068f9f3f2beb7f5ab8e81b004a43fee3b Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Tue, 26 Jan 2021 23:33:45 -0800 Subject: [PATCH] Avoid using HUGE font for button labels They were rendering very large, and shorter strings were being shrunk down less horizontally, so appearing stretched out (and touching the edges of the button needlessly). --- src/tuxpaint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 4fbb52724..f6f7a9bf0 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -7948,7 +7948,7 @@ static SDL_Surface *do_render_button_label(const char *const label) if (button_w <= ORIGINAL_BUTTON_SIZE) myfont = small_font; - else if (button_w <= ORIGINAL_BUTTON_SIZE * 2) + else if (button_w <= ORIGINAL_BUTTON_SIZE * 3) myfont = medium_font; else myfont = large_font; @@ -7957,6 +7957,7 @@ static SDL_Surface *do_render_button_label(const char *const label) myfont = locale_font; tmp_surf = render_text(myfont, upstr, black); free(upstr); + surf = thumbnail(tmp_surf, min(button_w, tmp_surf->w), min(18 * button_scale + button_label_y_nudge, tmp_surf->h), 0); SDL_FreeSurface(tmp_surf);