summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEv1lbl0w <ricasubtil@gmail.com>2021-10-24 16:27:08 +0100
committerEv1lbl0w <ricasubtil@gmail.com>2022-04-10 11:10:21 +0100
commit139c1eb655c1029445d430a2979b5ec93174b725 (patch)
treeb388071d972e418f9c22d71a52e9dc39537f7c4c
parent80801e5f66d180f15d151dd50b6d7731208a4dd5 (diff)
Clamp ratio from popup_centered_ratio
-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 a0f62c853f..d82d900080 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -1025,6 +1025,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;