[gtk/wip/otte/transform: 20/37] picture: Use new snapshot transforms



commit 80ba05ff2780203f7c163864b73bd974706373c6
Author: Benjamin Otte <otte redhat com>
Date:   Thu Feb 21 05:34:12 2019 +0100

    picture: Use new snapshot transforms

 gtk/gtkpicture.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkpicture.c b/gtk/gtkpicture.c
index 1ae495c35d..3dc7c9b91b 100644
--- a/gtk/gtkpicture.c
+++ b/gtk/gtkpicture.c
@@ -133,9 +133,10 @@ gtk_picture_snapshot (GtkWidget   *widget,
       x = (width - ceil (w)) / 2;
       y = floor(height - ceil (h)) / 2;
 
-      gtk_snapshot_offset (snapshot, x, y);
+      gtk_snapshot_save (snapshot);
+      gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
       gdk_paintable_snapshot (self->paintable, snapshot, w, h);
-      gtk_snapshot_offset (snapshot, -x, -y);
+      gtk_snapshot_restore (snapshot);
     }
 }
 


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