You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 19:41:11 +00:00
Fixed get_usable_parent_rect() errors when initialising popup menus.
This commit is contained in:
@@ -101,9 +101,11 @@ Size2 PopupMenu::_get_contents_minimum_size() const {
|
||||
minsize.width += check_w;
|
||||
}
|
||||
|
||||
int height_limit = get_usable_parent_rect().size.height;
|
||||
if (minsize.height > height_limit) {
|
||||
minsize.height = height_limit;
|
||||
if (is_inside_tree()) {
|
||||
int height_limit = get_usable_parent_rect().size.height;
|
||||
if (minsize.height > height_limit) {
|
||||
minsize.height = height_limit;
|
||||
}
|
||||
}
|
||||
|
||||
return minsize;
|
||||
|
||||
Reference in New Issue
Block a user