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
commitb0eceb65d728dd023ec8172d2b7e569b3dadebb3 (patch)
treed1b39e094ea0b59181c6e18d2bc9f7758a020c19
parent6e19fb7b367fabea650ca527ed70d5310e06f6df (diff)
downloadgtk+-b0eceb65d728dd023ec8172d2b7e569b3dadebb3.tar.gz
renderbackground: Use new snapshot transforms
-rw-r--r--gtk/gtkrenderbackground.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/gtk/gtkrenderbackground.c b/gtk/gtkrenderbackground.c
index 32e0305cab..ae04ab3bac 100644
--- a/gtk/gtkrenderbackground.c
+++ b/gtk/gtkrenderbackground.c
@@ -144,7 +144,7 @@ gtk_theming_background_snapshot_layer (GtkCssBoxes *bg,
gtk_snapshot_push_debug (snapshot, "Layer %u", idx);
gtk_snapshot_push_rounded_clip (snapshot, clip);
- gtk_snapshot_offset (snapshot, origin->bounds.origin.x, origin->bounds.origin.y);
+ gtk_snapshot_translate (snapshot, &origin->bounds.origin);
if (hrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT && vrepeat == GTK_CSS_REPEAT_STYLE_NO_REPEAT)
{
@@ -154,11 +154,12 @@ gtk_theming_background_snapshot_layer (GtkCssBoxes *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_offset (snapshot, x, y);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
gtk_css_image_snapshot (image, snapshot, image_width, image_height);
- gtk_snapshot_offset (snapshot, -x, -y);
+ gtk_snapshot_restore (snapshot);
}
else
{
@@ -255,16 +256,14 @@ gtk_theming_background_snapshot_layer (GtkCssBoxes *bg,
repeat_width, repeat_height
));
- gtk_snapshot_offset (snapshot,
- position_x + 0.5 * (repeat_width - image_width),
- position_y + 0.5 * (repeat_height - image_height));
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (
+ 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_offset (snapshot, - origin->bounds.origin.x, - origin->bounds.origin.y);
-
gtk_snapshot_pop (snapshot);
gtk_snapshot_pop (snapshot);
}