summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-04-11 17:49:20 +0200
committerGitHub <noreply@github.com>2022-04-11 17:49:20 +0200
commit2507b2b006c3f863e901a15166bc56054c20a22e (patch)
tree9b0a4b0ed4071ae5d9af6987e6f9bf743a38bd08 /scene
parent0fb3d69bb7eaa4b1853b82b5a365ce4a9fa798eb (diff)
parent139c1eb655c1029445d430a2979b5ec93174b725 (diff)
Merge pull request #54191 from Ev1lbl0w/bugfix-window_popup_ratio
Diffstat (limited to 'scene')
-rw-r--r--scene/main/window.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index 2858ffba6d..9a7ed1a0ec 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -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;