Skip to content

Commit

Permalink
Invalidate Control global transform before notifying about resize / r…
Browse files Browse the repository at this point in the history
…ect change
  • Loading branch information
kleonc committed May 30, 2024
1 parent 1e6b11d commit 22b6f96
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 22b6f96

Please sign in to comment.