From a4bb81b61c55822afdb76a2bd4a43db65cfb6778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 13 May 2020 20:25:22 +0200 Subject: [PATCH] inspector: Apply toplevel transform before snapshotting overlays --- gtk/gtkwidgetprivate.h | 6 ++++++ gtk/inspector/window.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h index 6c0b1513fb..d06db43250 100644 --- a/gtk/gtkwidgetprivate.h +++ b/gtk/gtkwidgetprivate.h @@ -476,6 +476,12 @@ _gtk_widget_is_sensitive (GtkWidget *widget) return !(widget->priv->state_flags & GTK_STATE_FLAG_INSENSITIVE); } +static inline GskTransform * +gtk_widget_get_transform (GtkWidget *widget) +{ + return widget->priv->transform; +} + G_END_DECLS #endif /* __GTK_WIDGET_PRIVATE_H__ */ diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c index 7742ecb8d9..a06454407f 100644 --- a/gtk/inspector/window.c +++ b/gtk/inspector/window.c @@ -62,6 +62,7 @@ #include "gtklayoutmanager.h" #include "gtkcssprovider.h" #include "gtkstylecontext.h" +#include "gtkwidgetprivate.h" enum { @@ -608,11 +609,16 @@ gtk_inspector_prepare_render (GtkWidget *widget, snapshot = gtk_snapshot_new (); gtk_snapshot_append_node (snapshot, node); + gtk_snapshot_save (snapshot); + gtk_snapshot_transform (snapshot, gtk_widget_get_transform (widget)); + for (l = iw->overlays; l; l = l->next) { gtk_inspector_overlay_snapshot (l->data, snapshot, node, widget); } + gtk_snapshot_restore (snapshot); + gsk_render_node_unref (node); node = gtk_snapshot_free_to_node (snapshot); }