[gtk+] Fix order of cairo clip setting when drawing text



commit 3e40146c04e3a6522b579261343b3ef555872ec1
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Aug 31 16:37:50 2009 +0200

    Fix order of cairo clip setting when drawing text
    
    We need to set the window clip region before applying the gc clip region,
    otherwise we will reset the gc clip region. Fixes bug 593595

 gdk/gdkgc.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdkgc.c b/gdk/gdkgc.c
index 13d9c8d..e721ff5 100644
--- a/gdk/gdkgc.c
+++ b/gdk/gdkgc.c
@@ -1486,6 +1486,10 @@ _gdk_gc_update_context (GdkGC          *gc,
     return;
 
   cairo_reset_clip (cr);
+  /* The reset above resets the window clip rect, so we want to re-set that */
+  if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
+    GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
+
   if (priv->clip_region)
     {
       cairo_save (cr);
@@ -1501,9 +1505,6 @@ _gdk_gc_update_context (GdkGC          *gc,
       cairo_clip (cr);
     }
 
-  /* The reset above resets the window clip rect, so we want to re-set that */
-  if (target_drawable && GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip)
-    GDK_DRAWABLE_GET_CLASS (target_drawable)->set_cairo_clip (target_drawable, cr);
 }
 
 



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