summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-02-21 05:34:12 +0100
committerBenjamin Otte <otte@redhat.com>2019-02-21 19:47:28 +0100
commita5a7cdd84b870b2d01ab9dd1981c8be222b83a2f (patch)
tree73469fb76334c1c0fdb952cee81f8fb8401c78bc
parent6cb8f638d1fbfb674df491f7d501e498a9c51c89 (diff)
downloadgtk+-a5a7cdd84b870b2d01ab9dd1981c8be222b83a2f.tar.gz
iconhelper: Use new snapshot transforms
-rw-r--r--gtk/gtkiconhelper.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index 6b8f63e9ff..5698b2bdbc 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -227,13 +227,14 @@ gtk_icon_helper_paintable_snapshot (GdkPaintable *paintable,
h = MIN (h, height);
x = (width - w) / 2;
y = (height - h) / 2;
- gtk_snapshot_offset (snapshot, x, y);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
gtk_css_style_snapshot_icon_paintable (style,
snapshot,
self->paintable,
w, h,
self->texture_is_symbolic);
- gtk_snapshot_offset (snapshot, -x, -y);
+ gtk_snapshot_restore (snapshot);
}
break;
@@ -268,13 +269,14 @@ gtk_icon_helper_paintable_snapshot (GdkPaintable *paintable,
x = floor (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));
gtk_css_style_snapshot_icon_paintable (style,
snapshot,
self->paintable,
w, h,
self->texture_is_symbolic);
- gtk_snapshot_offset (snapshot, -x, -y);
+ gtk_snapshot_restore (snapshot);
}
break;
}