From 6d2453425b8b577f4fb6ae993f7d1c8215314308 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Thu, 3 Aug 2023 10:25:05 -0300 Subject: [PATCH] Improve `Window._get_contents_minimum_size()`'s code --- scene/main/window.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 06ac7495b9c..d0658c489d9 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1748,9 +1748,11 @@ Rect2i Window::fit_rect_in_parent(Rect2i p_rect, const Rect2i &p_parent_rect) co Size2 Window::get_contents_minimum_size() const { ERR_READ_THREAD_GUARD_V(Size2()); - Vector2 ms = _get_contents_minimum_size(); - GDVIRTUAL_CALL(_get_contents_minimum_size, ms); - return ms; + Vector2 ms; + if (GDVIRTUAL_CALL(_get_contents_minimum_size, ms)) { + return ms; + } + return _get_contents_minimum_size(); } Size2 Window::get_clamped_minimum_size() const {