Skip to content

Commit

Permalink
Merge pull request #45201 from EricEzaM/PR/popup-menu-fix
Browse files Browse the repository at this point in the history
Fixed popup not calculating size correctly before adjusting its rect.
  • Loading branch information
akien-mga authored Feb 28, 2021
2 parents 8faecd6 + edc91f7 commit a6ec652
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scene/main/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1035,6 +1035,9 @@ void Window::popup_centered_ratio(float p_ratio) {
void Window::popup(const Rect2i &p_screen_rect) {
emit_signal("about_to_popup");

// Update window size to calculate the actual window size based on contents minimum size and minimum size.
_update_window_size();

if (p_screen_rect != Rect2i()) {
set_position(p_screen_rect.position);
set_size(p_screen_rect.size);
Expand Down

0 comments on commit a6ec652

Please sign in to comment.