Fixed get_usable_parent_rect() errors when initialising popup menus.
This commit is contained in:
parent
52f6ac81be
commit
13fd60572b
1 changed files with 5 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue