aboutsummaryrefslogtreecommitdiffstats
path: root/display.c
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2014-04-18 18:43:26 -0400
committerJesse Luehrs <doy@tozt.net>2014-04-18 18:43:26 -0400
commitcf0eb0339fc53557ab0c3dfc94de167bda33e08d (patch)
treeb5898f727a3053a6181607b0ccd636ffecd32921 /display.c
parent5b71f08f1ccd3d08512be8e700af30a6f3c24527 (diff)
downloadrunes-cf0eb0339fc53557ab0c3dfc94de167bda33e08d.tar.gz
runes-cf0eb0339fc53557ab0c3dfc94de167bda33e08d.zip
remove ascent from the term structure
pango lays out text from the upper left corner rather than from the baseline, so we don't need to track this ourselves anymore
Diffstat (limited to 'display.c')
-rw-r--r--display.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/display.c b/display.c
index ffed868..eba573f 100644
--- a/display.c
+++ b/display.c
@@ -385,6 +385,7 @@ static void runes_display_recalculate_font_metrics(RunesTerm *t)
PangoFontDescription *desc;
PangoContext *context;
PangoFontMetrics *metrics;
+ int ascent, descent;
desc = pango_font_description_from_string(t->font_name);
@@ -399,8 +400,9 @@ static void runes_display_recalculate_font_metrics(RunesTerm *t)
metrics = pango_context_get_metrics(context, desc, NULL);
t->fontx = pango_font_metrics_get_approximate_char_width(metrics) / PANGO_SCALE;
- t->ascent = pango_font_metrics_get_ascent(metrics) / PANGO_SCALE;
- t->fonty = t->ascent + pango_font_metrics_get_descent(metrics) / PANGO_SCALE;
+ ascent = pango_font_metrics_get_ascent(metrics);
+ descent = pango_font_metrics_get_descent(metrics);
+ t->fonty = (ascent + descent) / PANGO_SCALE;
pango_font_description_free(desc);
if (!t->layout) {