[gtk/wip/otte/transform: 33/41] stack: Use new snapshot transforms
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/transform: 33/41] stack: Use new snapshot transforms
- Date: Thu, 21 Feb 2019 04:41:06 +0000 (UTC)
commit cdf9a1030ac050486350eb6a6ecde53ff8b12b86
Author: Benjamin Otte <otte redhat com>
Date: Thu Feb 21 05:34:12 2019 +0100
stack: Use new snapshot transforms
gtk/gtkstack.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/gtk/gtkstack.c b/gtk/gtkstack.c
index 94de6d830b..f9a7723448 100644
--- a/gtk/gtkstack.c
+++ b/gtk/gtkstack.c
@@ -2095,13 +2095,12 @@ gtk_stack_snapshot_crossfade (GtkWidget *widget,
if (priv->last_visible_node)
{
- gtk_snapshot_offset (snapshot,
- priv->last_visible_surface_allocation.x,
- priv->last_visible_surface_allocation.y);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (
+ priv->last_visible_surface_allocation.x,
+ priv->last_visible_surface_allocation.y));
gtk_snapshot_append_node (snapshot, priv->last_visible_node);
- gtk_snapshot_offset (snapshot,
- -priv->last_visible_surface_allocation.x,
- -priv->last_visible_surface_allocation.y);
+ gtk_snapshot_restore (snapshot);
}
gtk_snapshot_pop (snapshot);
@@ -2163,9 +2162,10 @@ gtk_stack_snapshot_under (GtkWidget *widget,
if (priv->last_visible_node)
{
- gtk_snapshot_offset (snapshot, pos_x, pos_y);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (pos_x, pos_y));
gtk_snapshot_append_node (snapshot, priv->last_visible_node);
- gtk_snapshot_offset (snapshot, -pos_x, -pos_y);
+ gtk_snapshot_restore (snapshot);
}
}
@@ -2223,9 +2223,10 @@ gtk_stack_snapshot_slide (GtkWidget *widget,
y -= (priv->last_visible_widget_height - height) / 2;
}
- gtk_snapshot_offset (snapshot, x, y);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
gtk_snapshot_append_node (snapshot, priv->last_visible_node);
- gtk_snapshot_offset (snapshot, -x, -y);
+ gtk_snapshot_restore (snapshot);
}
gtk_widget_snapshot_child (widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]