summaryrefslogtreecommitdiff
path: root/gtk/gtkcalendar.c
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
commitefd92f7a9e9b4d88c4ea9ccd0845746ef3308c8f (patch)
treee443eb15a34c60f19db65e8923b8381ad9813332 /gtk/gtkcalendar.c
parent407307c7e4f6f84bf1f9ddee8d3b8ba3de3e53c1 (diff)
downloadgtk+-efd92f7a9e9b4d88c4ea9ccd0845746ef3308c8f.tar.gz
calendar: Use new snapshot transforms
Diffstat (limited to 'gtk/gtkcalendar.c')
-rw-r--r--gtk/gtkcalendar.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 561a474f5b..6b941ced3e 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -2010,9 +2010,9 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
get_component_paddings (calendar, NULL, &day_name_padding, NULL);
context = gtk_widget_get_style_context (widget);
- gtk_snapshot_offset (snapshot,
- inner_border,
- priv->header_h + inner_border);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot,
+ &GRAPHENE_POINT_INIT (inner_border, priv->header_h + inner_border));
day_width = priv->day_width;
cal_width = gtk_widget_get_width (widget) - (inner_border * 2);
@@ -2073,9 +2073,7 @@ calendar_snapshot_day_names (GtkCalendar *calendar,
g_object_unref (layout);
gtk_style_context_restore (context);
- gtk_snapshot_offset (snapshot,
- - inner_border,
- - (priv->header_h + inner_border));
+ gtk_snapshot_restore (snapshot);
}
static void
@@ -2403,16 +2401,15 @@ calendar_snapshot_arrow (GtkCalendar *calendar,
else
image_type = GTK_CSS_IMAGE_BUILTIN_ARROW_RIGHT;
- gtk_snapshot_offset (snapshot,
- rect.x + (rect.width - 8) / 2,
- rect.y + (rect.height - 8) / 2);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT(
+ 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_offset (snapshot,
- - rect.x - (rect.width - 8) / 2,
- - rect.y - (rect.height - 8) / 2);
+ gtk_snapshot_restore (snapshot);
gtk_style_context_restore (context);
}