[gtk+/wip/pango-shadow-cache] xxx clip



commit cc457080340139e8e52075013b17824436db8071
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Sep 3 10:23:01 2014 -0700

    xxx clip

 gtk/gtkcssshadowvalue.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c
index 154d903..9ce09bb 100644
--- a/gtk/gtkcssshadowvalue.c
+++ b/gtk/gtkcssshadowvalue.c
@@ -415,6 +415,7 @@ _gtk_css_shadow_value_paint_layout (const GtkCssValue *shadow,
                                     PangoLayout       *layout)
 {
   double x, y;
+  PangoRectangle ink_rect;
 
   g_return_if_fail (shadow->class == &GTK_CSS_VALUE_SHADOW);
 
@@ -424,6 +425,10 @@ _gtk_css_shadow_value_paint_layout (const GtkCssValue *shadow,
   cairo_translate (cr, x, y);
   cairo_new_sub_path (cr);
 
+  pango_layout_get_pixel_extents (layout, NULL, &ink_rect);
+  cairo_rectangle (cr, ink_rect.x, ink_rect.y, ink_rect.width, ink_rect.height);
+  cairo_clip (cr);
+
   cairo_translate (cr,
                    _gtk_css_number_value_get (shadow->hoffset, 0),
                    _gtk_css_number_value_get (shadow->voffset, 0));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]