diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2006-05-30 04:17:57 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2006-05-30 04:17:57 +0000 |
commit | 2707f73f24e379c6c96d3c7f72fdd7440dc5a9cd (patch) | |
tree | 3ef1eb5a8c3f93e7d43c42666f0dbfaffdc4007c /pango/pangocairo-render.c | |
parent | 80ec84414fa9096f34be97f762339b3ba35da247 (diff) | |
download | pango-2707f73f24e379c6c96d3c7f72fdd7440dc5a9cd.tar.gz |
Fix offset to center the underline in requested rectangle.
2006-05-30 Behdad Esfahbod <behdad@gnome.org>
* pango/pangocairo-render.c (draw_error_underline): Fix offset to
center the underline in requested rectangle.
* pango/pangocairo-render.c (pango_cairo_show_glyph_string): Remove
unncessary renderer activation and cleanup.
Diffstat (limited to 'pango/pangocairo-render.c')
-rw-r--r-- | pango/pangocairo-render.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/pango/pangocairo-render.c b/pango/pangocairo-render.c index bfd120f3..8d32e378 100644 --- a/pango/pangocairo-render.c +++ b/pango/pangocairo-render.c @@ -310,7 +310,7 @@ draw_error_underline (cairo_t *cr, double y_top, y_bottom; int i; - x += (width - width_units * unit_width); + x += (width - width_units * unit_width) / 2; width = width_units * unit_width; y_top = y; @@ -440,16 +440,7 @@ pango_cairo_show_glyph_string (cairo_t *cr, crenderer->do_path = FALSE; cairo_get_current_point (cr, &crenderer->x_offset, &crenderer->y_offset); - pango_renderer_activate (renderer); - - pango_renderer_set_color (renderer, PANGO_RENDER_PART_FOREGROUND, NULL); - pango_renderer_set_color (renderer, PANGO_RENDER_PART_BACKGROUND, NULL); - pango_renderer_set_color (renderer, PANGO_RENDER_PART_UNDERLINE, NULL); - pango_renderer_set_color (renderer, PANGO_RENDER_PART_STRIKETHROUGH, NULL); - pango_renderer_draw_glyphs (renderer, font, glyphs, 0, 0); - - pango_renderer_deactivate (renderer); if (G_UNLIKELY (unref_renderer)) g_object_unref (renderer); |