diff options
author | Owen Taylor <otaylor@redhat.com> | 2004-11-21 05:00:22 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2004-11-21 05:00:22 +0000 |
commit | 49f1502b5ccc88f8592dd217b28a04af52a2d691 (patch) | |
tree | c0130c0469f4914f0524e106c6e82996932d65e5 | |
parent | f6d966476dfe3a3fcd44941cd698b8153460a9ca (diff) | |
download | pango-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.
-rw-r--r-- | ChangeLog | 12 | ||||
-rw-r--r-- | ChangeLog.pre-1-10 | 12 | ||||
-rw-r--r-- | ChangeLog.pre-1-8 | 12 | ||||
-rw-r--r-- | pango/pangoxft-font.c | 8 | ||||
-rw-r--r-- | pango/pangoxft-render.c | 4 |
5 files changed, 42 insertions, 6 deletions
@@ -1,3 +1,15 @@ +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. + Fri Nov 19 18:45:24 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-renderer.c (pango_renderer_default_draw_error_underline): diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10 index 4975edd4..651d3868 100644 --- a/ChangeLog.pre-1-10 +++ b/ChangeLog.pre-1-10 @@ -1,3 +1,15 @@ +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. + Fri Nov 19 18:45:24 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-renderer.c (pango_renderer_default_draw_error_underline): diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8 index 4975edd4..651d3868 100644 --- a/ChangeLog.pre-1-8 +++ b/ChangeLog.pre-1-8 @@ -1,3 +1,15 @@ +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. + Fri Nov 19 18:45:24 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-renderer.c (pango_renderer_default_draw_error_underline): diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c index 884d49a5..0080ba81 100644 --- a/pango/pangoxft-font.c +++ b/pango/pangoxft-font.c @@ -197,16 +197,16 @@ get_glyph_extents_missing (PangoXftFont *xfont, if (ink_rect) { ink_rect->x = 0; - ink_rect->y = PANGO_SCALE * (- xft_font->ascent + (xft_font->ascent + xft_font->descent - xfont->mini_height * 2 - xfont->mini_pad * 5) / 2); - ink_rect->width = PANGO_SCALE * (xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 1)); - ink_rect->height = PANGO_SCALE * (xfont->mini_height * 2 + xfont->mini_pad * 5); + ink_rect->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); + ink_rect->width = xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 1); + ink_rect->height = xfont->mini_height * 2 + xfont->mini_pad * 5; } if (logical_rect) { logical_rect->x = 0; logical_rect->y = - PANGO_SCALE * xft_font->ascent; - logical_rect->width = PANGO_SCALE * (xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 2)); + logical_rect->width = xfont->mini_width * cols + xfont->mini_pad * (2 * cols + 2); logical_rect->height = (xft_font->ascent + xft_font->descent) * PANGO_SCALE; } } 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; |