diff options
| author | Pawel Kowal | 2016-07-27 20:24:10 +0200 |
|---|---|---|
| committer | Pawel Kowal | 2016-07-27 20:24:10 +0200 |
| commit | 853161a0000b54bdb85cb57d2e07020bed16589e (patch) | |
| tree | 9abe575870e78f45d2de1e2479fdf3555a8e7a40 | |
| parent | 6273ec901faec2823c8f4801244d1cffbbe9b118 (diff) | |
| download | godot-853161a0000b54bdb85cb57d2e07020bed16589e.tar.gz godot-853161a0000b54bdb85cb57d2e07020bed16589e.tar.zst godot-853161a0000b54bdb85cb57d2e07020bed16589e.zip | |
ScrollContainer expand children bug fix
| -rw-r--r-- | doc/base/classes.xml | 2 | ||||
| -rw-r--r-- | scene/gui/scroll_container.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/doc/base/classes.xml b/doc/base/classes.xml index d70b11b5a..d1ba170dd 100644 --- a/doc/base/classes.xml +++ b/doc/base/classes.xml @@ -34139,7 +34139,7 @@ A helper node for displaying scrollable elements (e.g. lists). </brief_description> <description> - A ScrollContainer node with a [Control] child and scrollbar child ([HScrollbar], [VScrollBar], or both) will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the minimum_size of the Control relative to the ScrollContainer. Works great with a [Panel] control. + A ScrollContainer node with a [Control] child and scrollbar child ([HScrollbar], [VScrollBar], or both) will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the minimum_size of the Control relative to the ScrollContainer. Works great with a [Panel] control. You can set EXPAND on children size flags, so they will upscale to ScrollContainer size if ScrollContainer size is bigger (scroll is invisible for chosen dimension). </description> <methods> <method name="get_h_scroll" qualifiers="const"> diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 190e8e141..0fa2856ca 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -228,14 +228,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) { + if (!h_scroll->is_visible()) { 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) { + if (!v_scroll->is_visible()) { r.pos.y=0; r.size.height=size.height; if (c->get_v_size_flags()&SIZE_EXPAND) |
