From 574918f3446bd17174b4efb5f021eeeb5dcd622a Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Thu, 16 Jan 2020 09:38:32 +0800 Subject: [PATCH] Updates ScrollContainer min size when toggle scrollbars --- scene/gui/scroll_container.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 05645d0263c..e8f6fee27a9 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -452,8 +452,12 @@ void ScrollContainer::_scroll_moved(float) { }; void ScrollContainer::set_enable_h_scroll(bool p_enable) { + if (scroll_h == p_enable) { + return; + } scroll_h = p_enable; + minimum_size_changed(); queue_sort(); } @@ -463,8 +467,12 @@ bool ScrollContainer::is_h_scroll_enabled() const { } void ScrollContainer::set_enable_v_scroll(bool p_enable) { + if (scroll_v == p_enable) { + return; + } scroll_v = p_enable; + minimum_size_changed(); queue_sort(); }