Merge pull request #54191 from Ev1lbl0w/bugfix-window_popup_ratio

This commit is contained in:
Rémi Verschelde 2022-04-11 17:49:20 +02:00 committed by GitHub
commit 2507b2b006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1079,6 +1079,7 @@ void Window::popup_centered(const Size2i &p_minsize) {
void Window::popup_centered_ratio(float p_ratio) {
ERR_FAIL_COND(!is_inside_tree());
ERR_FAIL_COND_MSG(window_id == DisplayServer::MAIN_WINDOW_ID, "Can't popup the main window.");
ERR_FAIL_COND_MSG(p_ratio <= 0.0 || p_ratio > 1.0, "Ratio must be between 0.0 and 1.0!");
Rect2 parent_rect;