summaryrefslogtreecommitdiffstats
path: root/scene
diff options
context:
space:
mode:
authorkleonc <9283098+kleonc@users.noreply.github.com>2024-05-28 21:48:43 +0200
committerkleonc <9283098+kleonc@users.noreply.github.com>2024-05-30 10:10:24 +0200
commit22b6f962d928e278e524a676144c3be8d3c09352 (patch)
tree18b63ee0c5b1f2a11e0e02be2101f6f07ef09acf /scene
parent1e6b11dcd4ad3abb7c621674674b718f5e0a2278 (diff)
downloadredot-engine-22b6f962d928e278e524a676144c3be8d3c09352.tar.gz
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) {