Skip to content

Commit

Permalink
[textbox] Fix aliasing variable name. (thanks to xsy420)
Browse files Browse the repository at this point in the history
Issue: #2036
  • Loading branch information
DaveDavenport committed Oct 18, 2024
1 parent 186b0e7 commit df7d8b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/widgets/textbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,17 @@ static void textbox_initialize_font(textbox *tb) {

// Try to find height from font. Might be slow?
TICK_N("Get font height");
PangoFont *font = pango_context_load_font(p_context, tbfc->pfd);
if (font) {
PangoFontMetrics *fm = pango_font_get_metrics(font, NULL);
PangoFont *context_font = pango_context_load_font(p_context, tbfc->pfd);
if (context_font) {
PangoFontMetrics *fm = pango_font_get_metrics(context_font, NULL);
if (fm) {
int h = pango_font_metrics_get_height(fm) / PANGO_SCALE;
if (h > 0) {
tbfc->height = h;
}
pango_font_metrics_unref(fm);
}
g_object_unref(font);
g_object_unref(context_font);
}
TICK_N("Get font height");
g_object_unref(layout);
Expand Down

0 comments on commit df7d8b6

Please sign in to comment.