summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-05-30 11:48:09 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-05-30 11:48:09 +0200
commitadbc4b086b4d562e5d5fef7911ddd3afc5912397 (patch)
treebcb989b4a6b4a14ff016aeda6abdbe0c7c08a4bb /scene
parent32def9f98ed43330916aeba1b0fbdd61c3dfab80 (diff)
parent22b6f962d928e278e524a676144c3be8d3c09352 (diff)
downloadredot-engine-adbc4b086b4d562e5d5fef7911ddd3afc5912397.tar.gz
Merge pull request #92489 from kleonc/control-invalidate-global-transform-before-notifying-resize
Invalidate `Control` global transform before notifying about resize / rect change
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/control.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp
index 0d5c69b207..0682c11a9b 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) {