From 8f84f4117cafbf97605a4d3da5fcb80cec83cc99 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 25 Oct 2015 20:08:18 -0300 Subject: [PATCH] -Fixed a bug in scrollcontainer not respecting expand flag If you relied on this, make sure the children of your scrollcontainer is set to expand with the expand flag in either vertical or horizontal axis --- scene/gui/scroll_container.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 8f753f51bcd..e5b5d531a05 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -195,11 +195,19 @@ void ScrollContainer::_notification(int p_what) { Rect2 r = Rect2(-scroll,minsize); if (!scroll_h) { r.pos.x=0; - r.size.width=size.width; + 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) { r.pos.y=0; r.size.height=size.height; + if (c->get_v_size_flags()&SIZE_EXPAND) + r.size.height=MAX(size.height,minsize.height); + else + r.size.height=minsize.height; + } fit_child_in_rect(c,r); }