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
commit380c4ece8d08a01e40f69a6ec8c467bc3bda9bef (patch)
treee6ba3167efe83566bb55fb9bc1b8593e74b076b5
parent6df2023e9d14853fa49dacf84fb5a6846b3e2832 (diff)
downloadgtk+-380c4ece8d08a01e40f69a6ec8c467bc3bda9bef.tar.gz
stylecontext: Use new snapshot transforms
-rw-r--r--gtk/gtkstylecontext.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 094fe1a29f..e765c852dc 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -1901,25 +1901,27 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
cursor1 = &weak_pos;
}
- gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor1->x), y + PANGO_PIXELS (cursor1->y));
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (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_offset (snapshot, - x - PANGO_PIXELS (cursor1->x), - y - PANGO_PIXELS (cursor1->y));
+ gtk_snapshot_restore (snapshot);
if (direction2 != PANGO_DIRECTION_NEUTRAL)
{
- gtk_snapshot_offset (snapshot, x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y));
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x + PANGO_PIXELS (cursor2->x), y + PANGO_PIXELS (cursor2->y)));
snapshot_insertion_cursor (snapshot,
context,
PANGO_PIXELS (cursor2->height),
FALSE,
direction2,
TRUE);
- gtk_snapshot_offset (snapshot, - x - PANGO_PIXELS (cursor2->x), - y - PANGO_PIXELS (cursor2->y));
+ gtk_snapshot_restore (snapshot);
}
}