Skip to content

Commit adbc4b0

Browse files
committed
Merge pull request godotengine#92489 from kleonc/control-invalidate-global-transform-before-notifying-resize
Invalidate `Control` global transform before notifying about resize / rect change
2 parents 32def9f + 22b6f96 commit adbc4b0

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

scene/gui/control.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,12 +1739,15 @@ void Control::_size_changed() {
17391739
data.size_cache = new_size_cache;
17401740

17411741
if (is_inside_tree()) {
1742-
if (size_changed) {
1743-
notification(NOTIFICATION_RESIZED);
1744-
}
17451742
if (pos_changed || size_changed) {
1746-
item_rect_changed(size_changed);
1743+
// Ensure global transform is marked as dirty before `NOTIFICATION_RESIZED` / `item_rect_changed` signal
1744+
// so an up to date global transform could be obtained when handling these.
17471745
_notify_transform();
1746+
1747+
if (size_changed) {
1748+
notification(NOTIFICATION_RESIZED);
1749+
}
1750+
item_rect_changed(size_changed);
17481751
}
17491752

17501753
if (pos_changed && !size_changed) {

0 commit comments

Comments
 (0)