From 20e269655b94f199811dc798c5e0384c55a9cf39 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 3 May 2024 19:00:44 -0400 Subject: [PATCH] Hack: Debug for text bounds Set DEBUG_TEXT_BOUNDS=1 to see the bounds of your text nodes as beautiful yellow boxes. --- gsk/gpu/gskgpunodeprocessor.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gsk/gpu/gskgpunodeprocessor.c b/gsk/gpu/gskgpunodeprocessor.c index 5113826d3b..746afe12e8 100644 --- a/gsk/gpu/gskgpunodeprocessor.c +++ b/gsk/gpu/gskgpunodeprocessor.c @@ -3019,6 +3019,17 @@ gsk_gpu_node_processor_add_glyph_node (GskGpuNodeProcessor *self, return; } + if (g_getenv ("DEBUG_TEXT_BOUNDS")) + { + GdkRGBA color; + GskRenderNode *c; + + gdk_rgba_parse (&color, "yellow"); + c = gsk_color_node_new (&color, &node->bounds); + gsk_gpu_node_processor_add_color_node (self, c); + gsk_render_node_unref (c); + } + device = gsk_gpu_frame_get_device (self->frame); color = *gsk_text_node_get_color (node);