Skip to content

Commit

Permalink
Fix performance for godot's interface
Browse files Browse the repository at this point in the history
  • Loading branch information
guilhermefelipecgs committed Jul 1, 2018
1 parent 3852c5f commit b2e78e1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scene/gui/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,16 @@ void Control::_update_minimum_size_cache() {
Size2 minsize = get_minimum_size();
minsize.x = MAX(minsize.x, data.custom_minimum_size.x);
minsize.y = MAX(minsize.y, data.custom_minimum_size.y);

bool size_changed = false;
if (data.minimum_size_cache != minsize)
size_changed = true;

data.minimum_size_cache = minsize;
data.minimum_size_valid = true;
minimum_size_changed();

if (size_changed)
minimum_size_changed();
}

Size2 Control::get_combined_minimum_size() const {
Expand Down
1 change: 1 addition & 0 deletions scene/gui/item_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ void ItemList::_notification(int p_what) {
}
}

minimum_size_changed();
shape_changed = false;
}

Expand Down

0 comments on commit b2e78e1

Please sign in to comment.