summaryrefslogtreecommitdiff
path: root/pango/pangocairo-render.c
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2015-06-05 14:33:54 -0700
committerBehdad Esfahbod <behdad@behdad.org>2015-06-05 14:33:54 -0700
commitb66375a1cce0f33a565ec3c4a3dc83bbf6ceb640 (patch)
tree5ca5af135f7505bf3b2400515ee33986bf052e73 /pango/pangocairo-render.c
parent5e5b6f9388a12803a94fc90fc01c53bca51315ac (diff)
downloadpango-b66375a1cce0f33a565ec3c4a3dc83bbf6ceb640.tar.gz
Bug 750463 - hexboxes broken for some combining characters
Diffstat (limited to 'pango/pangocairo-render.c')
-rw-r--r--pango/pangocairo-render.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c
index 03a2811a..f668f3b7 100644
--- a/pango/pangocairo-render.c
+++ b/pango/pangocairo-render.c
@@ -341,6 +341,7 @@ _pango_cairo_renderer_draw_unknown_glyph (PangoCairoRenderer *crenderer,
double x0, y0;
int row, col;
int rows, cols;
+ double width, lsb;
char hexbox_string[2] = {0, 0};
PangoCairoFontHexBoxInfo *hbi;
gunichar ch;
@@ -369,10 +370,12 @@ _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));
+ lsb = ((double)gi->geometry.width / PANGO_SCALE - width) * .5;
_pango_cairo_renderer_draw_frame (crenderer,
- cx + hbi->pad_x * 1.5,
+ cx + lsb,
cy + hbi->box_descent - hbi->box_height + hbi->pad_y * 0.5,
- (double)gi->geometry.width / PANGO_SCALE - 3 * hbi->pad_x,
+ width,
(hbi->box_height - hbi->pad_y),
hbi->line_width,
invalid_input);
@@ -380,7 +383,7 @@ _pango_cairo_renderer_draw_unknown_glyph (PangoCairoRenderer *crenderer,
if (invalid_input)
goto done;
- x0 = cx + hbi->pad_x * 3.0;
+ x0 = cx + lsb + hbi->pad_x * 1.5;
y0 = cy + hbi->box_descent - hbi->pad_y * 2;
for (row = 0; row < rows; row++)