diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2005-07-16 01:01:04 +0000 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@comhem.se> | 2005-07-16 01:01:04 +0000 |
| commit | a08bb4abba37c2ee88c32423cd4d5ba916e74f49 (patch) | |
| tree | 7c7eba2d21f4068a4bb3636b31cab9b02009babd /render | |
| parent | a5100fe6770d5b223cf444eda5629c2b2208cb29 (diff) | |
minor movement of code
Diffstat (limited to 'render')
| -rw-r--r-- | render/font.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/render/font.c b/render/font.c index 71302467..d751cba1 100644 --- a/render/font.c +++ b/render/font.c @@ -264,9 +264,15 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area) #endif /* USE_PANGO */ /* center vertically */ -#ifndef USE_PANGO /* We have to wait for the text string with pango */ +#ifndef USE_PANGO y = area->y + (area->height - RrFontHeight(t->font)) / 2; +#else + y = area->y + + area->height / 2 + + /* go to great lengths to center the text while keeping the baseline in + * the same place */ + t->font->pango_descent / PANGO_SCALE; #endif /* the +2 and -4 leave a small blank edge on the sides */ x = area->x + 2; @@ -305,11 +311,6 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area) /* pango_layout_set_alignment(pl, (PangoAlignment)(t->justify)); */ pango_layout_get_pixel_extents(pl, NULL, &rect); mw = rect.width; - y = area->y + - area->height / 2 + - /* go to great lengths to center the text while keeping the baseline in - * the same place */ - t->font->pango_descent / PANGO_SCALE; #endif /* USE_PANGO */ |
