From 22b6f962d928e278e524a676144c3be8d3c09352 Mon Sep 17 00:00:00 2001 From: kleonc <9283098+kleonc@users.noreply.github.com> Date: Tue, 28 May 2024 21:48:43 +0200 Subject: [PATCH] Invalidate Control global transform before notifying about resize / rect change --- scene/gui/control.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 0d5c69b20764..0682c11a9b27 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -1739,12 +1739,15 @@ void Control::_size_changed() { data.size_cache = new_size_cache; if (is_inside_tree()) { - if (size_changed) { - notification(NOTIFICATION_RESIZED); - } if (pos_changed || size_changed) { - item_rect_changed(size_changed); + // Ensure global transform is marked as dirty before `NOTIFICATION_RESIZED` / `item_rect_changed` signal + // so an up to date global transform could be obtained when handling these. _notify_transform(); + + if (size_changed) { + notification(NOTIFICATION_RESIZED); + } + item_rect_changed(size_changed); } if (pos_changed && !size_changed) {