summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-07-15 13:14:13 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-07-15 13:18:23 -0400
commitaaa68954c34a31fb95b717f2fed6736037e0d644 (patch)
treef18ea0692900c810ed2aa92d7b73f3ca1da12ba0
parent67952a91420bc6230eac7f68700b38595322813f (diff)
downloadgtk+-aaa68954c34a31fb95b717f2fed6736037e0d644.tar.gz
snapshot: Handle transparent opacity nodes correctly
Eliding totally transparent content from the node tree is not 100% correct, since filters can make things visible, so we need to at least preserve the bounds. We can do that by creating a transparent color node.
-rw-r--r--gtk/gtksnapshot.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index b0b1222c66..ad5533982a 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -30,6 +30,8 @@
#include "gtkstylecontextprivate.h"
#include "gsktransformprivate.h"
+#include "gdk/gdkrgbaprivate.h"
+
#include "gsk/gskrendernodeprivate.h"
#include "gsk/gskroundedrectprivate.h"
@@ -461,8 +463,12 @@ gtk_snapshot_collect_opacity (GtkSnapshot *snapshot,
}
else if (state->data.opacity.opacity == 0.0)
{
+ GdkRGBA color = GDK_RGBA ("00000000");
+ graphene_rect_t bounds;
+
+ gsk_render_node_get_bounds (node, &bounds);
+ opacity_node = gsk_color_node_new (&color, &bounds);
gsk_render_node_unref (node);
- opacity_node = NULL;
}
else
{