From 97b51dc070e0fa12b1286d804d9bfd9f394fbbaa Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 7 Aug 2024 04:08:58 +0200 Subject: [PATCH] inspector: Print opaque rect of nodes Also change the way rectangles are printed by including the bottom right coordinate, too. I'm still not sure what the best way is, but at least I no longer get confused and it has the infos I want. --- gtk/inspector/recorder.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c index 71aa73391c..7846e9332e 100644 --- a/gtk/inspector/recorder.c +++ b/gtk/inspector/recorder.c @@ -1033,7 +1033,7 @@ static void populate_render_node_properties (GListStore *store, GskRenderNode *node) { - graphene_rect_t bounds; + graphene_rect_t bounds, opaque; g_list_store_remove_all (store); @@ -1042,11 +1042,25 @@ populate_render_node_properties (GListStore *store, add_text_row (store, "Type", "%s", node_type_name (gsk_render_node_get_node_type (node))); add_text_row (store, "Bounds", - "%.2f x %.2f + %.2f + %.2f", - bounds.size.width, - bounds.size.height, + "(%.2f, %.2f) to (%.2f, %.2f) - %.2f x %.2f", bounds.origin.x, - bounds.origin.y); + bounds.origin.y, + bounds.origin.x + bounds.size.width, + bounds.origin.y + bounds.size.height, + bounds.size.width, + bounds.size.height); + + if (gsk_render_node_get_opaque_rect (node, &opaque)) + add_text_row (store, "Opaque", + "(%.2f, %.2f) to (%.2f, %.2f) - %.2f x %.2f", + opaque.origin.x, + opaque.origin.y, + opaque.origin.x + opaque.size.width, + opaque.origin.y + opaque.size.height, + opaque.size.width, + opaque.size.height); + else + add_text_row (store, "Opaque", "no"); switch (gsk_render_node_get_node_type (node)) {