[gtk/wip/otte/transform: 27/37] textview: Use new snapshot transforms
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/transform: 27/37] textview: Use new snapshot transforms
- Date: Thu, 21 Feb 2019 06:23:06 +0000 (UTC)
commit 199305086d8c2e0791df432c4296357ce0291b74
Author: Benjamin Otte <otte redhat com>
Date: Thu Feb 21 05:34:12 2019 +0100
textview: Use new snapshot transforms
gtk/gtktextview.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 083d181e02..6da0b597e9 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -5337,7 +5337,8 @@ gtk_text_view_paint (GtkWidget *widget,
area->width, area->height);
#endif
- gtk_snapshot_offset (snapshot, -priv->xoffset, -priv->yoffset);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (-priv->xoffset, -priv->yoffset));
gtk_text_layout_snapshot (priv->layout,
widget,
@@ -5349,7 +5350,7 @@ gtk_text_view_paint (GtkWidget *widget,
gtk_widget_get_height (widget)
});
- gtk_snapshot_offset (snapshot, priv->xoffset, priv->yoffset);
+ gtk_snapshot_restore (snapshot);
}
static void
@@ -5374,18 +5375,20 @@ draw_text (GtkWidget *widget,
if (GTK_TEXT_VIEW_GET_CLASS (text_view)->snapshot_layer != NULL)
{
- gtk_snapshot_offset (snapshot, -priv->xoffset, -priv->yoffset);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (-priv->xoffset, -priv->yoffset));
GTK_TEXT_VIEW_GET_CLASS (text_view)->snapshot_layer (text_view, GTK_TEXT_VIEW_LAYER_BELOW_TEXT,
snapshot);
- gtk_snapshot_offset (snapshot, priv->xoffset, priv->yoffset);
+ gtk_snapshot_restore (snapshot);
}
gtk_text_view_paint (widget, snapshot);
if (GTK_TEXT_VIEW_GET_CLASS (text_view)->snapshot_layer != NULL)
{
- gtk_snapshot_offset (snapshot, -priv->xoffset, -priv->yoffset);
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (-priv->xoffset, -priv->yoffset));
GTK_TEXT_VIEW_GET_CLASS (text_view)->snapshot_layer (text_view, GTK_TEXT_VIEW_LAYER_ABOVE_TEXT,
snapshot);
- gtk_snapshot_offset (snapshot, priv->xoffset, priv->yoffset);
+ gtk_snapshot_restore (snapshot);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]