diff options
| author | Juan Linietsky | 2015-10-25 20:08:18 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2015-10-25 20:08:18 -0300 |
| commit | 8f84f4117cafbf97605a4d3da5fcb80cec83cc99 (patch) | |
| tree | bc5c454e5470468ab32cbf2e219948a0203e04a6 /scene/gui/scroll_container.cpp | |
| parent | d123c89c5802777e02402108d9271ed2f29368fe (diff) | |
| download | godot-8f84f4117cafbf97605a4d3da5fcb80cec83cc99.tar.gz godot-8f84f4117cafbf97605a4d3da5fcb80cec83cc99.tar.zst godot-8f84f4117cafbf97605a4d3da5fcb80cec83cc99.zip | |
-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
Diffstat (limited to 'scene/gui/scroll_container.cpp')
| -rw-r--r-- | scene/gui/scroll_container.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 8f753f51b..e5b5d531a 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); } |
