[nautilus] icon-canvas-item: don't forget to clip the embedded text rectangle
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] icon-canvas-item: don't forget to clip the embedded text rectangle
- Date: Mon, 19 Sep 2011 21:15:14 +0000 (UTC)
commit 2cb91c05718dc5463a52eadf24e6036adfe6e10e
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Sep 19 17:14:00 2011 -0400
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
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 7ba1c34..ee60a39 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. */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]