summaryrefslogtreecommitdiff
path: root/pango/pangoxft-render.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-11-21 05:00:22 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-11-21 05:00:22 +0000
commit49f1502b5ccc88f8592dd217b28a04af52a2d691 (patch)
treec0130c0469f4914f0524e106c6e82996932d65e5 /pango/pangoxft-render.c
parentf6d966476dfe3a3fcd44941cd698b8153460a9ca (diff)
downloadpango-49f1502b5ccc88f8592dd217b28a04af52a2d691.tar.gz
Fix double multiplication by PANGO_SCALE. (#157419, Matthias Clasen)
Sat Nov 20 23:50:40 2004 Owen Taylor <otaylor@redhat.com> * pango/pangoxft-font.c (get_glyph_extents_missing): Fix double multiplication by PANGO_SCALE. (#157419, Matthias Clasen) * pango/pangoxft-render.c (box_in_bounds): Fix sign typo. * pango/pangoxft-render.c (pango_xft_renderer_draw_glyphs): * pango/pangoxft-font.c (get_glyph_extents_missing): Adjust vertical positioning so that we get integral positioning of the box without a transform.
Diffstat (limited to 'pango/pangoxft-render.c')
-rw-r--r--pango/pangoxft-render.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pango/pangoxft-render.c b/pango/pangoxft-render.c
index 1c156405..44d15ddb 100644
--- a/pango/pangoxft-render.c
+++ b/pango/pangoxft-render.c
@@ -279,7 +279,7 @@ box_in_bounds (PangoRenderer *renderer,
if (!renderer->matrix)
{
#define COORD_MIN (PANGO_SCALE * -16384 - PANGO_SCALE / 2)
-#define COORD_MAX (PANGO_SCALE * -32767 + PANGO_SCALE / 2 - 1)
+#define COORD_MAX (PANGO_SCALE * 32767 + PANGO_SCALE / 2 - 1)
return (x >= COORD_MIN && x + width <= COORD_MAX &&
y >= COORD_MIN && y + width <= COORD_MAX);
#undef COORD_MIN
@@ -348,7 +348,7 @@ pango_xft_renderer_draw_glyphs (PangoRenderer *renderer,
glyph &= ~PANGO_XFT_UNKNOWN_FLAG;
- ys[0] = glyph_y - PANGO_SCALE * xft_font->ascent + (PANGO_SCALE * (xft_font->ascent + xft_font->descent) - xfont->mini_height * 2 - xfont->mini_pad * 5) / 2;
+ ys[0] = glyph_y - PANGO_SCALE * xft_font->ascent + PANGO_SCALE * (((xft_font->ascent + xft_font->descent) - (xfont->mini_height * 2 + xfont->mini_pad * 5 + PANGO_SCALE / 2) / PANGO_SCALE) / 2);
ys[1] = ys[0] + 2 * xfont->mini_pad + xfont->mini_height;
ys[2] = ys[1] + xfont->mini_height + xfont->mini_pad;