diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-09-19 17:14:00 -0400 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-09-19 17:14:00 -0400 |
commit | 2cb91c05718dc5463a52eadf24e6036adfe6e10e (patch) | |
tree | 3159062629c6c3aa86591213deae8a9d501adbf2 /libnautilus-private | |
parent | bf1f6bde79f5226388551780dcd7f148c8f55734 (diff) | |
download | nautilus-2cb91c05718dc5463a52eadf24e6036adfe6e10e.tar.gz |
icon-canvas-item: don't forget to clip the embedded text rectangle
When drawing the embedded text, the pango layout should be clipped to
the computed rectangle.
https://bugzilla.gnome.org/show_bug.cgi?id=659518
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-icon-canvas-item.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libnautilus-private/nautilus-icon-canvas-item.c b/libnautilus-private/nautilus-icon-canvas-item.c index 7ba1c347f..ee60a39d0 100644 --- a/libnautilus-private/nautilus-icon-canvas-item.c +++ b/libnautilus-private/nautilus-icon-canvas-item.c @@ -1409,12 +1409,22 @@ draw_embedded_text (NautilusIconCanvasItem *item, gtk_style_context_save (style_context); gtk_style_context_add_class (style_context, "icon-embedded-text"); + cairo_save (cr); + + cairo_rectangle (cr, + x + item->details->embedded_text_rect.x, + y + item->details->embedded_text_rect.y, + item->details->embedded_text_rect.width, + item->details->embedded_text_rect.height); + cairo_clip (cr); + gtk_render_layout (style_context, cr, x + item->details->embedded_text_rect.x, y + item->details->embedded_text_rect.y, layout); gtk_style_context_restore (style_context); + cairo_restore (cr); } /* Draw the icon item for non-anti-aliased mode. */ |