summaryrefslogtreecommitdiff
path: root/pango/pangocairo-render.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2015-06-07 11:08:13 -0700
committerBehdad Esfahbod <behdad@behdad.org>2015-06-07 11:08:13 -0700
commitdfe7ec760e08485520668ed1e2585c85545fc013 (patch)
tree8e0ae6ed570e4717b938f775e31d9dd4224312f1 /pango/pangocairo-render.c
parentb66375a1cce0f33a565ec3c4a3dc83bbf6ceb640 (diff)
downloadpango-dfe7ec760e08485520668ed1e2585c85545fc013.tar.gz
Bug 750463 - hexboxes broken for some combining characters
Round lsb.
Diffstat (limited to 'pango/pangocairo-render.c')
-rw-r--r--pango/pangocairo-render.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c
index f668f3b7..3855fc26 100644
--- a/pango/pangocairo-render.c
+++ b/pango/pangocairo-render.c
@@ -370,12 +370,14 @@ _pango_cairo_renderer_draw_unknown_glyph (PangoCairoRenderer *crenderer,
g_snprintf (buf, sizeof(buf), (ch > 0xffff) ? "%06X" : "%04X", ch);
}
- width = (2 * hbi->pad_x + cols * (hbi->digit_width + hbi->pad_x));
+ width = (3 * hbi->pad_x + cols * (hbi->digit_width + hbi->pad_x));
lsb = ((double)gi->geometry.width / PANGO_SCALE - width) * .5;
+ lsb = floor (lsb / hbi->pad_x) * hbi->pad_x;
+
_pango_cairo_renderer_draw_frame (crenderer,
- cx + lsb,
+ cx + lsb + .5 * hbi->pad_x,
cy + hbi->box_descent - hbi->box_height + hbi->pad_y * 0.5,
- width,
+ width - hbi->pad_x,
(hbi->box_height - hbi->pad_y),
hbi->line_width,
invalid_input);
@@ -383,7 +385,7 @@ _pango_cairo_renderer_draw_unknown_glyph (PangoCairoRenderer *crenderer,
if (invalid_input)
goto done;
- x0 = cx + lsb + hbi->pad_x * 1.5;
+ x0 = cx + lsb + hbi->pad_x * 2;
y0 = cy + hbi->box_descent - hbi->pad_y * 2;
for (row = 0; row < rows; row++)