[cairo-commit] src/cairo-scaled-font.c
Behdad Esfahbod
behdad at kemper.freedesktop.org
Thu Feb 28 15:53:51 PST 2008
src/cairo-scaled-font.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 523c7dbf6db85e75624ae111179dedb570212bb2
Author: Behdad Esfahbod <behdad at behdad.org>
Date: Thu Feb 28 18:53:08 2008 -0500
[cairo-scaled-font] Pedantic check for zero-area glyphs
diff --git a/src/cairo-scaled-font.c b/src/cairo-scaled-font.c
index 3d9e32a..9bab7d3 100644
--- a/src/cairo-scaled-font.c
+++ b/src/cairo-scaled-font.c
@@ -1049,7 +1049,7 @@ cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font,
}
/* "Ink" extents should skip "invisible" glyphs */
- if (scaled_glyph->metrics.width == 0 && scaled_glyph->metrics.height == 0)
+ if (scaled_glyph->metrics.width == 0 || scaled_glyph->metrics.height == 0)
continue;
left = scaled_glyph->metrics.x_bearing + glyphs[i].x;
@@ -1089,7 +1089,7 @@ cairo_scaled_font_glyph_extents (cairo_scaled_font_t *scaled_font,
x0 = glyphs[0].x;
y0 = glyphs[0].y;
- /* scaled_glyphs contains the glyph for num_glyphs - 1 already. */
+ /* scaled_glyph contains the glyph for num_glyphs - 1 already. */
x1 = glyphs[num_glyphs - 1].x + scaled_glyph->metrics.x_advance;
y1 = glyphs[num_glyphs - 1].y + scaled_glyph->metrics.y_advance;
More information about the cairo-commit
mailing list