mirror of
https://github.com/godotengine/godot.git
synced 2025-01-24 21:01:50 +08:00
Merge pull request #41801 from EricEzaM/PR/popup-menu-errors-fix
Fixed get_usable_parent_rect() errors when initialising popup menus.
This commit is contained in:
commit
c6b044903d
@ -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 New Issue
Block a user