From c12d1fe29ccf2d5354c2cd6166b27bf52b57464b Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 5 Jul 2024 05:12:57 +0200 Subject: [PATCH] rendernode-tool: Show the whole node When the node had negative coords, those were cut off. Translate by the node's origin to avoid this. --- tools/gtk-rendernode-tool-show.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/gtk-rendernode-tool-show.c b/tools/gtk-rendernode-tool-show.c index 2892869d9b..653ed9c617 100644 --- a/tools/gtk-rendernode-tool-show.c +++ b/tools/gtk-rendernode-tool-show.c @@ -57,6 +57,7 @@ show_file (const char *filename, gboolean decorated) { GskRenderNode *node; + graphene_rect_t node_bounds; GdkPaintable *paintable; GtkWidget *sw; GtkWidget *window; @@ -65,8 +66,10 @@ show_file (const char *filename, GtkWidget *picture; node = load_node_file (filename); + gsk_render_node_get_bounds (node, &node_bounds); snapshot = gtk_snapshot_new (); + gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (- node_bounds.origin.x, - node_bounds.origin.y)); gtk_snapshot_append_node (snapshot, node); paintable = gtk_snapshot_free_to_paintable (snapshot, NULL);