From e9316a009e08e8fe9aa961a0ccef2a77ba7133fc Mon Sep 17 00:00:00 2001 From: Pawel Kowal Date: Wed, 25 Jan 2017 21:21:44 +0100 Subject: [PATCH] Fix #7011 ScrollContainer takes into account child's EXPAND flag when scrolling is enabled --- scene/gui/scroll_container.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index bad478a7459..c92f573922c 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -236,14 +236,14 @@ void ScrollContainer::_notification(int p_what) { child_max_size.y = MAX(child_max_size.y, minsize.y); Rect2 r = Rect2(-scroll,minsize); - if (!(scroll_h || h_scroll->is_visible())) { + if (!scroll_h || (!h_scroll->is_visible() && c->get_h_size_flags()&SIZE_EXPAND)) { r.pos.x=0; if (c->get_h_size_flags()&SIZE_EXPAND) r.size.width=MAX(size.width,minsize.width); else r.size.width=minsize.width; } - if (!(scroll_v || v_scroll->is_visible())) { + if (!scroll_v || (!v_scroll->is_visible() && c->get_v_size_flags()&SIZE_EXPAND)) { r.pos.y=0; r.size.height=size.height; if (c->get_v_size_flags()&SIZE_EXPAND)