[gtk+] snapshot: Rename gtk_snapshot_translate_2d()



commit 87497ca2e1abd2ce52b4dfe6b8aa12f17feeaf10
Author: Benjamin Otte <otte redhat com>
Date:   Fri Jan 13 14:36:56 2017 +0100

    snapshot: Rename gtk_snapshot_translate_2d()
    
    It's now called gtk_snapshot_offset().

 docs/reference/gtk/gtk4-sections.txt |    3 ++-
 gtk/gtkbuiltinicon.c                 |    4 ++--
 gtk/gtkcalendar.c                    |   28 ++++++++++++++--------------
 gtk/gtkcellrendererpixbuf.c          |    4 ++--
 gtk/gtkcellrenderertoggle.c          |    6 +++---
 gtk/gtkcssgadget.c                   |    8 ++++----
 gtk/gtkiconhelper.c                  |   12 ++++++------
 gtk/gtkiconview.c                    |    6 +++---
 gtk/gtkimage.c                       |    4 ++--
 gtk/gtkpaned.c                       |    4 ++--
 gtk/gtkrenderbackground.c            |   14 +++++++-------
 gtk/gtksnapshot.c                    |   30 +++++++++++++++---------------
 gtk/gtksnapshot.h                    |    2 +-
 gtk/gtkstylecontext.c                |    8 ++++----
 gtk/gtktreeview.c                    |   16 ++++++++--------
 gtk/gtkwidget.c                      |    8 ++++----
 16 files changed, 79 insertions(+), 78 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index cb93cf9..93b5d89 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4463,7 +4463,8 @@ gtk_snapshot_push_blend
 gtk_snapshot_pop
 gtk_snapshot_set_transform
 gtk_snapshot_transform
-gtk_snapshot_translate_2d
+gtk_snapshot_offset
+gtk_snapshot_get_offset
 gtk_snapshot_append_node
 gtk_snapshot_append_cairo
 gtk_snapshot_append_texture
diff --git a/gtk/gtkbuiltinicon.c b/gtk/gtkbuiltinicon.c
index 7b9d27e..60003b6 100644
--- a/gtk/gtkbuiltinicon.c
+++ b/gtk/gtkbuiltinicon.c
@@ -137,12 +137,12 @@ gtk_builtin_icon_snapshot (GtkCssGadget *gadget,
 {
   GtkBuiltinIconPrivate *priv = gtk_builtin_icon_get_instance_private (GTK_BUILTIN_ICON (gadget));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_icon (gtk_css_gadget_get_style (gadget),
                                snapshot,
                                width, height,
                                priv->image_type);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 
   return FALSE;
 }
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 532bc36..5c37e6f 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -2158,7 +2158,7 @@ calendar_snapshot_header (GtkCalendar *calendar,
   get_component_paddings (calendar, &padding, NULL, NULL, NULL);
   context = gtk_widget_get_style_context (widget);
 
-  gtk_snapshot_translate_2d (snapshot, padding.left, padding.top);
+  gtk_snapshot_offset (snapshot, padding.left, padding.top);
 
   if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
     year_left = priv->year_before;
@@ -2246,7 +2246,7 @@ calendar_snapshot_header (GtkCalendar *calendar,
   g_object_unref (layout);
 
   gtk_style_context_restore (context);
-  gtk_snapshot_translate_2d (snapshot, -padding.left, -padding.top);
+  gtk_snapshot_offset (snapshot, -padding.left, -padding.top);
 }
 
 static void
@@ -2272,9 +2272,9 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
   get_component_paddings (calendar, &padding, NULL, &day_name_padding, NULL);
   context = gtk_widget_get_style_context (widget);
 
-  gtk_snapshot_translate_2d (snapshot,
-                             padding.left + inner_border,
-                             priv->header_h + padding.top + inner_border);
+  gtk_snapshot_offset (snapshot,
+                       padding.left + inner_border,
+                       priv->header_h + padding.top + inner_border);
 
   gtk_widget_get_allocation (widget, &allocation);
 
@@ -2337,9 +2337,9 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
   g_object_unref (layout);
 
   gtk_style_context_restore (context);
-  gtk_snapshot_translate_2d (snapshot,
-                             - (padding.left + inner_border),
-                             - (priv->header_h + padding.top + inner_border));
+  gtk_snapshot_offset (snapshot,
+                       - (padding.left + inner_border),
+                       - (priv->header_h + padding.top + inner_border));
 }
 
 static void
@@ -2717,16 +2717,16 @@ calendar_snapshot_arrow (GtkCalendar *calendar,
   else
     image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT;
 
-  gtk_snapshot_translate_2d (snapshot,
-                             rect.x + (rect.width - 8) / 2,
-                             rect.y + (rect.height - 8) / 2);
+  gtk_snapshot_offset (snapshot,
+                       rect.x + (rect.width - 8) / 2,
+                       rect.y + (rect.height - 8) / 2);
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context),
                                snapshot,
                                8, 8,
                                image_type);
-  gtk_snapshot_translate_2d (snapshot,
-                             - rect.x - (rect.width - 8) / 2,
-                             - rect.y - (rect.height - 8) / 2);
+  gtk_snapshot_offset (snapshot,
+                       - rect.x - (rect.width - 8) / 2,
+                       - rect.y - (rect.height - 8) / 2);
 
   gtk_style_context_restore (context);
 }
diff --git a/gtk/gtkcellrendererpixbuf.c b/gtk/gtkcellrendererpixbuf.c
index 0cda2e7..675f8b3 100644
--- a/gtk/gtkcellrendererpixbuf.c
+++ b/gtk/gtkcellrendererpixbuf.c
@@ -541,9 +541,9 @@ gtk_cell_renderer_pixbuf_snapshot (GtkCellRenderer      *cell,
   if (icon_helper == NULL)
     icon_helper = create_icon_helper (cellpixbuf, widget);
 
-  gtk_snapshot_translate_2d (snapshot, pix_rect.x, pix_rect.y);
+  gtk_snapshot_offset (snapshot, pix_rect.x, pix_rect.y);
   gtk_icon_helper_snapshot (icon_helper, snapshot);
-  gtk_snapshot_translate_2d (snapshot, - pix_rect.x, - pix_rect.y);
+  gtk_snapshot_offset (snapshot, - pix_rect.x, - pix_rect.y);
 
   g_object_unref (icon_helper);
 
diff --git a/gtk/gtkcellrenderertoggle.c b/gtk/gtkcellrenderertoggle.c
index 5022474..c88a8ac 100644
--- a/gtk/gtkcellrenderertoggle.c
+++ b/gtk/gtkcellrenderertoggle.c
@@ -456,9 +456,9 @@ gtk_cell_renderer_toggle_snapshot (GtkCellRenderer      *cell,
         image_type = GTK_CSS_IMAGE_BUILTIN_NONE;
     }
 
-  gtk_snapshot_translate_2d (snapshot,
-                             cell_area->x + x_offset + xpad + padding.left + border.left,
-                             cell_area->y + y_offset + ypad + padding.top + border.top);
+  gtk_snapshot_offset (snapshot,
+                       cell_area->x + x_offset + xpad + padding.left + border.left,
+                       cell_area->y + y_offset + ypad + padding.top + border.top);
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context), snapshot,
                                width - padding.left - padding.right - border.left - border.right,
                                height - padding.top - padding.bottom - border.top - border.bottom,
diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c
index f2ee456..abf83e9 100644
--- a/gtk/gtkcssgadget.c
+++ b/gtk/gtkcssgadget.c
@@ -861,7 +861,7 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
   get_box_border (style, &border);
   get_box_padding (style, &padding);
 
-  gtk_snapshot_translate_2d (snapshot, x + margin.left, y + margin.top);
+  gtk_snapshot_offset (snapshot, x + margin.left, y + margin.top);
   gtk_css_style_snapshot_background (style,
                                      snapshot,
                                      width - margin.left - margin.right,
@@ -870,7 +870,7 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
                                  snapshot,
                                  width - margin.left - margin.right,
                                  height - margin.top - margin.bottom);
-  gtk_snapshot_translate_2d (snapshot, - x - margin.left, - y - margin.top);
+  gtk_snapshot_offset (snapshot, - x - margin.left, - y - margin.top);
 
   contents_x = x + margin.left + border.left + padding.left;
   contents_y = y + margin.top + border.top + padding.top;
@@ -885,12 +885,12 @@ gtk_css_gadget_snapshot (GtkCssGadget *gadget,
 
   if (draw_focus)
     {
-      gtk_snapshot_translate_2d (snapshot, x + margin.left, y + margin.top);
+      gtk_snapshot_offset (snapshot, x + margin.left, y + margin.top);
       gtk_css_style_snapshot_outline (style,
                                       snapshot,
                                       width - margin.left - margin.right,
                                       height - margin.top - margin.bottom);
-      gtk_snapshot_translate_2d (snapshot, - x - margin.left, - y - margin.top);
+      gtk_snapshot_offset (snapshot, - x - margin.left, - y - margin.top);
   }
 }
 
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index 15d6e42..048dfac 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -143,13 +143,13 @@ gtk_icon_helper_real_snapshot (GtkCssGadget *gadget,
   int icon_width, icon_height;
 
   _gtk_icon_helper_get_size (self, &icon_width, &icon_height);
-  gtk_snapshot_translate_2d (snapshot,
-                             x + (width - icon_width) / 2,
-                             y + (height - icon_height) / 2);
+  gtk_snapshot_offset (snapshot,
+                       x + (width - icon_width) / 2,
+                       y + (height - icon_height) / 2);
   gtk_icon_helper_snapshot (self, snapshot);
-  gtk_snapshot_translate_2d (snapshot,
-                             - (x + (width - icon_width) / 2),
-                             - (y + (height - icon_height) / 2));
+  gtk_snapshot_offset (snapshot,
+                       - (x + (width - icon_width) / 2),
+                       - (y + (height - icon_height) / 2));
 
   return FALSE;
 }
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 580208f..b17e8bc 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -1766,9 +1766,9 @@ gtk_icon_view_snapshot (GtkWidget   *widget,
                           ),
                           "IconView Clip");
 
-  gtk_snapshot_translate_2d (snapshot,
-                             - gtk_adjustment_get_value (icon_view->priv->hadjustment),
-                             - gtk_adjustment_get_value (icon_view->priv->vadjustment));
+  gtk_snapshot_offset (snapshot,
+                       - gtk_adjustment_get_value (icon_view->priv->hadjustment),
+                       - gtk_adjustment_get_value (icon_view->priv->vadjustment));
 
   gtk_icon_view_get_drag_dest_item (icon_view, &path, &dest_pos);
 
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 271018b..d788270 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -1463,9 +1463,9 @@ gtk_image_render_contents (GtkCssGadget *gadget,
     }
   else
     {
-      gtk_snapshot_translate_2d (snapshot, x, y);
+      gtk_snapshot_offset (snapshot, x, y);
       gtk_icon_helper_snapshot (priv->icon_helper, snapshot);
-      gtk_snapshot_translate_2d (snapshot, -x, -y);
+      gtk_snapshot_offset (snapshot, -x, -y);
     }
 
   return FALSE;
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 2762074..13edfd4 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -1715,14 +1715,14 @@ gtk_paned_render_handle (GtkCssGadget *gadget,
   GtkStyleContext *context = gtk_widget_get_style_context (widget);
 
   gtk_style_context_save_to_node (context, gtk_css_gadget_get_node (priv->handle_gadget));
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
 
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context),
                                snapshot,
                                width, height,
                                GTK_CSS_IMAGE_BUILTIN_PANE_SEPARATOR);
 
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
   gtk_style_context_restore (context);
 
   return FALSE;
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index b7a46bd..8e87e9e 100644
--- a/gtk/gtkrenderbackground.c
+++ b/gtk/gtkrenderbackground.c
@@ -389,7 +389,7 @@ gtk_theming_background_snapshot_layer (GtkThemingBackground *bg,
 
   gtk_snapshot_push_rounded_clip (snapshot, clip, "BackgroundLayerClip<%u>", idx);
 
-  gtk_snapshot_translate_2d (snapshot, origin->bounds.origin.x, origin->bounds.origin.y);
+  gtk_snapshot_offset (snapshot, origin->bounds.origin.x, origin->bounds.origin.y);
 
   if (hrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT && vrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT)
     {
@@ -399,11 +399,11 @@ gtk_theming_background_snapshot_layer (GtkThemingBackground *bg,
       x = _gtk_css_position_value_get_x (pos, width - image_width);
       y = _gtk_css_position_value_get_y (pos, height - image_height);
 
-      gtk_snapshot_translate_2d (snapshot, x, y);
+      gtk_snapshot_offset (snapshot, x, y);
 
       gtk_css_image_snapshot (image, snapshot, image_width, image_height);
 
-      gtk_snapshot_translate_2d (snapshot, -x, -y);
+      gtk_snapshot_offset (snapshot, -x, -y);
     }
   else
     {
@@ -501,15 +501,15 @@ gtk_theming_background_snapshot_layer (GtkThemingBackground *bg,
                                 ),
                                 "BackgroundLayerRepeat<%u>", idx);
                                 
-      gtk_snapshot_translate_2d (snapshot,
-                                 position_x + 0.5 * (repeat_width - image_width),
-                                 position_y + 0.5 * (repeat_height - image_height));
+      gtk_snapshot_offset (snapshot,
+                           position_x + 0.5 * (repeat_width - image_width),
+                           position_y + 0.5 * (repeat_height - image_height));
       gtk_css_image_snapshot (image, snapshot, image_width, image_height);
 
       gtk_snapshot_pop (snapshot);
     }
 
-  gtk_snapshot_translate_2d (snapshot, - origin->bounds.origin.x, - origin->bounds.origin.y);
+  gtk_snapshot_offset (snapshot, - origin->bounds.origin.x, - origin->bounds.origin.y);
 
   gtk_snapshot_pop (snapshot);
 }
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index 00d6242..7b8bfdd 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -958,7 +958,7 @@ gtk_snapshot_get_renderer (const GtkSnapshot *snapshot)
 }
 
 /**
- * gtk_snapshot_translate_2d:
+ * gtk_snapshot_offset:
  * @snapshot: a $GtkSnapshot
  * @x: horizontal translation
  * @y: vertical translation
@@ -968,9 +968,9 @@ gtk_snapshot_get_renderer (const GtkSnapshot *snapshot)
  * Since: 3.90
  */
 void
-gtk_snapshot_translate_2d (GtkSnapshot *snapshot,
-                           int          x,
-                           int          y)
+gtk_snapshot_offset (GtkSnapshot *snapshot,
+                     int          x,
+                     int          y)
 {
   snapshot->state->translate_x += x;
   snapshot->state->translate_y += y;
@@ -983,7 +983,7 @@ gtk_snapshot_translate_2d (GtkSnapshot *snapshot,
  * @y: (out) (optional): return location for y offset
  *
  * Queries the offset managed by @snapshot. This offset is the
- * accumulated sum of calls to gtk_snapshot_translate_2d().
+ * accumulated sum of calls to gtk_snapshot_offset().
  *
  * Use this offset to determine how to offset nodes that you
  * manually add to the snapshot using
@@ -1235,11 +1235,11 @@ gtk_snapshot_render_background (GtkSnapshot     *snapshot,
   g_return_if_fail (snapshot != NULL);
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_background (gtk_style_context_lookup_style (context),
                                      snapshot,
                                      width, height);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1268,11 +1268,11 @@ gtk_snapshot_render_frame (GtkSnapshot     *snapshot,
   g_return_if_fail (snapshot != NULL);
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_border (gtk_style_context_lookup_style (context),
                                  snapshot,
                                  width, height);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1301,11 +1301,11 @@ gtk_snapshot_render_focus (GtkSnapshot     *snapshot,
   g_return_if_fail (snapshot != NULL);
   g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_outline (gtk_style_context_lookup_style (context),
                                   snapshot,
                                   width, height);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1350,7 +1350,7 @@ gtk_snapshot_render_layout (GtkSnapshot     *snapshot,
                       ink_rect.width + shadow_extents.left + shadow_extents.right,
                       ink_rect.height + shadow_extents.top + shadow_extents.bottom);
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
 
   cr = gtk_snapshot_append_cairo (snapshot, &bounds, "Text<%dchars>", pango_layout_get_character_count 
(layout));
 
@@ -1360,7 +1360,7 @@ gtk_snapshot_render_layout (GtkSnapshot     *snapshot,
   pango_cairo_show_layout (cr, layout);
 
   cairo_destroy (cr);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 /**
@@ -1387,12 +1387,12 @@ gtk_snapshot_render_icon (GtkSnapshot     *snapshot,
   GskTexture *texture;
 
   texture = gsk_texture_new_for_pixbuf (pixbuf);
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_css_style_snapshot_icon_texture (gtk_style_context_lookup_style (context),
                                        snapshot,
                                        texture,
                                        1);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
   g_object_unref (texture);
 }
 
diff --git a/gtk/gtksnapshot.h b/gtk/gtksnapshot.h
index 1e28dd1..39ebd25 100644
--- a/gtk/gtksnapshot.h
+++ b/gtk/gtksnapshot.h
@@ -93,7 +93,7 @@ GDK_AVAILABLE_IN_3_90
 void            gtk_snapshot_pop                        (GtkSnapshot            *snapshot);
 
 GDK_AVAILABLE_IN_3_90
-void            gtk_snapshot_translate_2d               (GtkSnapshot            *snapshot,
+void            gtk_snapshot_offset                     (GtkSnapshot            *snapshot,
                                                          int                     x,
                                                          int                     y);
 GDK_AVAILABLE_IN_3_90
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 8374663..15157bd 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -2284,25 +2284,25 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot     *snapshot,
         cursor1 = &weak_pos;
     }
 
-  gtk_snapshot_translate_2d (snapshot, x + PANGO_PIXELS (cursor1->x), y + PANGO_PIXELS (cursor1->y));
+  gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor1->x), y + PANGO_PIXELS (cursor1->y));
   snapshot_insertion_cursor (snapshot,
                              context,
                              PANGO_PIXELS (cursor1->height),
                              TRUE,
                              direction,
                              direction2 != PANGO_DIRECTION_NEUTRAL);
-  gtk_snapshot_translate_2d (snapshot, - x - PANGO_PIXELS (cursor1->x), - y - PANGO_PIXELS (cursor1->y));
+  gtk_snapshot_offset (snapshot, - x - PANGO_PIXELS (cursor1->x), - y - PANGO_PIXELS (cursor1->y));
 
   if (direction2 != PANGO_DIRECTION_NEUTRAL)
     {
-      gtk_snapshot_translate_2d (snapshot, x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y));
+      gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y));
       snapshot_insertion_cursor (snapshot,
                                  context,
                                  PANGO_PIXELS (cursor2->height),
                                  FALSE,
                                  direction2,
                                  TRUE);
-      gtk_snapshot_translate_2d (snapshot, - x - PANGO_PIXELS (cursor2->x), - y - PANGO_PIXELS (cursor2->y));
+      gtk_snapshot_offset (snapshot, - x - PANGO_PIXELS (cursor2->x), - y - PANGO_PIXELS (cursor2->y));
     }
 }
 
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 10d80f4..898d5ba 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -5393,13 +5393,13 @@ gtk_tree_view_snapshot (GtkWidget   *widget,
                           ),
                           "TreeViewContentClip");
 
-  gtk_snapshot_translate_2d (snapshot,
-                             - (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
-                             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_tree_view_bin_snapshot (widget, snapshot);
-  gtk_snapshot_translate_2d (snapshot,
-                             (gint) gtk_adjustment_get_value (tree_view->priv->hadjustment),
-                             - 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));
 
   /* 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
@@ -10052,10 +10052,10 @@ 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_translate_2d (snapshot, area.x, area.y);
+  gtk_snapshot_offset (snapshot, area.x, area.y);
   gtk_css_style_snapshot_icon (gtk_style_context_lookup_style (context), snapshot,
                                area.width, area.height, image_type);
-  gtk_snapshot_translate_2d (snapshot, -area.x, -area.y);
+  gtk_snapshot_offset (snapshot, -area.x, -area.y);
 
   gtk_style_context_restore (context);
 }
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 0c1b740..ff666b3 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -15854,8 +15854,8 @@ gtk_widget_get_translation_to_child (GtkWidget *widget,
  * gtk_widget_snapshot_child:
  * @widget: a #GtkWidget
  * @child: a child of @widget
- * @snapshot: $GtkSnapshot as passed to the container. In particular, no
- *   calls to gtk_snapshot_translate_2d() should have been applied by the
+ * @snapshot: #GtkSnapshot as passed to the container. In particular, no
+ *   calls to gtk_snapshot_offset() should have been applied by the
  *   parent.
  *
  * When a widget receives a call to the snapshot function, it must send
@@ -15882,9 +15882,9 @@ gtk_widget_snapshot_child (GtkWidget   *widget,
 
   gtk_widget_get_translation_to_child (widget, child, &x, &y);
 
-  gtk_snapshot_translate_2d (snapshot, x, y);
+  gtk_snapshot_offset (snapshot, x, y);
   gtk_widget_snapshot (child, snapshot);
-  gtk_snapshot_translate_2d (snapshot, -x, -y);
+  gtk_snapshot_offset (snapshot, -x, -y);
 }
 
 void


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