From 8db84be008a797f04b2d8557cb0c196c74da5059 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Sun, 2 Jun 2024 11:04:43 -0700 Subject: [PATCH] Drop `button_label_y_nudge`; no longer needed `button_label_y_nudge`, used in `tuxpaint.c` to nudge button label text down, was only ever used with Khmer language and is no longer necessary (the text was actually appearing _too_ low now). Removing that, as well the `lang_y_nudge[]` look-up table, and use of the values (`setup_i18n()` and `set_current_language()`) inside `i18n.c`. --- src/tuxpaint.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 6c7fa4586..0b2099226 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -9725,7 +9725,7 @@ static SDL_Surface *do_render_button_label(const char *const label) DEBUG_PRINTF("Rendered as: %d x %d\n", tmp_surf->w, tmp_surf->h); - want_h = (int)(18 * button_scale + button_label_y_nudge) * height_mult; + want_h = (int)(18 * button_scale) * height_mult; DEBUG_PRINTF(" button_w = %d -- min w = %d\n", button_w, min(button_w, tmp_surf->w)); DEBUG_PRINTF(" want_h = %d -- min h = %d\n", want_h, min(want_h, tmp_surf->h)); @@ -10159,7 +10159,7 @@ static void draw_toolbar(void) dest.y = ((i / 2) * button_h) + r_ttools.h + (2 * button_w) / ORIGINAL_BUTTON_SIZE + - (((46 + button_label_y_nudge) * button_w) / ORIGINAL_BUTTON_SIZE - img_tool_names[tool]->h) + off_y; + ((46 * button_w) / ORIGINAL_BUTTON_SIZE - img_tool_names[tool]->h) + off_y; SDL_BlitSurface(img_tool_names[tool], NULL, screen, &dest); } @@ -28493,7 +28493,8 @@ static void setup_config(char *argv[]) tmpcfg.parsertmp_lang = NULL; if (tmpcfg.parsertmp_locale == PARSE_CLOBBER) tmpcfg.parsertmp_locale = NULL; - button_label_y_nudge = setup_i18n(tmpcfg.parsertmp_lang, tmpcfg.parsertmp_locale, &num_wished_langs); + + setup_i18n(tmpcfg.parsertmp_lang, tmpcfg.parsertmp_locale, &num_wished_langs); /* Determine the referred font for the current locale */ PANGO_DEFAULT_FONT_FALLBACK = NULL;