[gtk] treeview: Use new snapshot transforms



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

    treeview: Use new snapshot transforms

 gtk/gtktreeview.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 9e838c2319..b9ec23b274 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -4925,13 +4925,12 @@ gtk_tree_view_snapshot (GtkWidget   *widget,
                               height - gtk_tree_view_get_effective_header_height (tree_view)
                           ));
 
-  gtk_snapshot_offset (snapshot,
-                       - (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
-                       gtk_tree_view_get_effective_header_height (tree_view));
+  gtk_snapshot_save (snapshot);
+  gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (
+                          - (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
+                          gtk_tree_view_get_effective_header_height (tree_view)));
   gtk_tree_view_bin_snapshot (widget, snapshot);
-  gtk_snapshot_offset (snapshot,
-                       (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
-                       - gtk_tree_view_get_effective_header_height (tree_view));
+  gtk_snapshot_restore (snapshot);
 
   /* We can't just chain up to Container::draw as it will try to send the
    * event to the headers, so we handle propagating it to our children
@@ -9386,10 +9385,11 @@ gtk_tree_view_snapshot_arrow (GtkTreeView   *tree_view,
   gtk_style_context_set_state (context, state);
   gtk_style_context_add_class (context, GTK_STYLE_CLASS_EXPANDER);
 
-  gtk_snapshot_offset (snapshot, area.x, area.y);
+  gtk_snapshot_save (snapshot);
+  gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (area.x, area.y));
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context), snapshot,
                                area.width, area.height, image_type);
-  gtk_snapshot_offset (snapshot, -area.x, -area.y);
+  gtk_snapshot_restore (snapshot);
 
   gtk_style_context_restore (context);
 }


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