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).
This commit is contained in:
Bill Kendrick 2021-01-26 23:33:45 -08:00
parent 3ebb76e7bb
commit 73eef80068

View file

@ -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);