[gtk/wip/otte/transform: 40/41] layoutoverlay: Use new snapshot transforms
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/transform: 40/41] layoutoverlay: Use new snapshot transforms
- Date: Thu, 21 Feb 2019 04:41:41 +0000 (UTC)
commit 29225e28640c7d2ee801b3aa02e3d93f9596d708
Author: Benjamin Otte <otte redhat com>
Date: Thu Feb 21 05:34:12 2019 +0100
layoutoverlay: Use new snapshot transforms
gtk/inspector/layoutoverlay.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/inspector/layoutoverlay.c b/gtk/inspector/layoutoverlay.c
index b2f860135d..5b13b6e6b8 100644
--- a/gtk/inspector/layoutoverlay.c
+++ b/gtk/inspector/layoutoverlay.c
@@ -92,10 +92,11 @@ recurse_child_widgets (GtkWidget *widget,
gtk_widget_get_allocation (widget, &allocation);
+ gtk_snapshot_save (snapshot);
/* Offset for all of the drawing done here. We assume cooridinates relative to
* the widget allocation, not the content allocation. */
- gtk_snapshot_offset (snapshot, allocation.x, allocation.y);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (allocation.x, allocation.y));
/* Now do all the stuff */
gtk_snapshot_push_debug (snapshot, "Widget layout debugging");
@@ -184,12 +185,11 @@ recurse_child_widgets (GtkWidget *widget,
const int offset_x = margin.left + border.left + padding.left;
const int offset_y = margin.top + border.top + padding.top;
- gtk_snapshot_offset (snapshot, offset_x, offset_y);
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (offset_x, offset_y));
recurse_child_widgets (child, snapshot);
- gtk_snapshot_offset (snapshot, - offset_x, - offset_y);
}
- gtk_snapshot_offset (snapshot, - allocation.x, - allocation.y);
+ gtk_snapshot_restore (snapshot);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]