summaryrefslogtreecommitdiff
path: root/pango/pangocairo-font.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2007-04-18 20:16:56 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2007-04-18 20:16:56 +0000
commit7292ace486dd5593ef8d1e9c311c629a5723c8e5 (patch)
tree66ba75ff36ada87e5e6514861a05168983c8db3a /pango/pangocairo-font.c
parent8ec2822cc5b8839996aaeb062f6acc0a899d98b4 (diff)
downloadpango-7292ace486dd5593ef8d1e9c311c629a5723c8e5.tar.gz
Improved hexbox position.
2007-04-18 Behdad Esfahbod <behdad@gnome.org> * pango/pangocairo-font.c (_pango_cairo_font_get_hex_box_info): Improved hexbox position. svn path=/trunk/; revision=2227
Diffstat (limited to 'pango/pangocairo-font.c')
-rw-r--r--pango/pangocairo-font.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pango/pangocairo-font.c b/pango/pangocairo-font.c
index 68130e28..d779b983 100644
--- a/pango/pangocairo-font.c
+++ b/pango/pangocairo-font.c
@@ -280,9 +280,13 @@ _pango_cairo_font_get_hex_box_info (PangoCairoFont *cfont)
hbi->box_height = 3 * hbi->pad_y + rows * (hbi->pad_y + hbi->digit_height);
- if (rows == 1)
+ if (rows == 1 || hbi->box_height <= font_extents.ascent)
{
- hbi->box_descent = hbi->pad_y;
+ hbi->box_descent = 2 * hbi->pad_y;
+ }
+ else if (hbi->box_height <= font_extents.ascent + font_extents.descent - 2 * hbi->pad_y)
+ {
+ hbi->box_descent = 2 * hbi->pad_y + hbi->box_height - font_extents.ascent;
}
else
{