[gtk: 2/2] rendernodepaintable: Fix clipping



commit ab9455ea1bd2a5c6a675a7038e99d4bd621879b6
Author: Benjamin Otte <otte redhat com>
Date:   Wed Sep 5 16:24:25 2018 +0200

    rendernodepaintable: Fix clipping
    
    We need to translate before clipping, otherwise we clip in totally the
    wrong place.

 gtk/gtkrendernodepaintable.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkrendernodepaintable.c b/gtk/gtkrendernodepaintable.c
index 2d7248e2f4..35fcd2f545 100644
--- a/gtk/gtkrendernodepaintable.c
+++ b/gtk/gtkrendernodepaintable.c
@@ -60,14 +60,17 @@ gtk_render_node_paintable_paintable_snapshot (GdkPaintable *paintable,
                                    &transform);
     }
 
-  gtk_snapshot_push_clip (snapshot, &self->bounds);
   gtk_snapshot_offset (snapshot, -self->bounds.origin.x, -self->bounds.origin.y);
 
+  gtk_snapshot_push_clip (snapshot, &self->bounds);
+
   gtk_snapshot_append_node (snapshot, self->node);
+  //gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 1, 0, 0, 1 }, &self->bounds);
 
-  gtk_snapshot_offset (snapshot, self->bounds.origin.x, self->bounds.origin.y);
   gtk_snapshot_pop (snapshot);
 
+  gtk_snapshot_offset (snapshot, self->bounds.origin.x, self->bounds.origin.y);
+
   if (needs_transform)
     gtk_snapshot_pop (snapshot);
 }


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