inspector: Apply toplevel transform before snapshotting overlays

This commit is contained in:
Timm Bäder 2020-05-13 20:25:22 +02:00
parent 01c0acb707
commit a4bb81b61c
2 changed files with 12 additions and 0 deletions

View File

@ -476,6 +476,12 @@ _gtk_widget_is_sensitive (GtkWidget *widget)
return !(widget->priv->state_flags & GTK_STATE_FLAG_INSENSITIVE); 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 G_END_DECLS
#endif /* __GTK_WIDGET_PRIVATE_H__ */ #endif /* __GTK_WIDGET_PRIVATE_H__ */

View File

@ -62,6 +62,7 @@
#include "gtklayoutmanager.h" #include "gtklayoutmanager.h"
#include "gtkcssprovider.h" #include "gtkcssprovider.h"
#include "gtkstylecontext.h" #include "gtkstylecontext.h"
#include "gtkwidgetprivate.h"
enum { enum {
@ -608,11 +609,16 @@ gtk_inspector_prepare_render (GtkWidget *widget,
snapshot = gtk_snapshot_new (); snapshot = gtk_snapshot_new ();
gtk_snapshot_append_node (snapshot, node); 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) for (l = iw->overlays; l; l = l->next)
{ {
gtk_inspector_overlay_snapshot (l->data, snapshot, node, widget); gtk_inspector_overlay_snapshot (l->data, snapshot, node, widget);
} }
gtk_snapshot_restore (snapshot);
gsk_render_node_unref (node); gsk_render_node_unref (node);
node = gtk_snapshot_free_to_node (snapshot); node = gtk_snapshot_free_to_node (snapshot);
} }