summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorPawel Kowal <pkowal1982@gmail.com>2017-01-25 21:21:44 +0100
committerRĂ©mi Verschelde <rverschelde@gmail.com>2017-02-02 08:24:37 +0100
commitb602096b9b5a31ff0e8ac0123a0210189179bbc6 (patch)
tree190614963fe97b851423cdc065a340980ffe5d38 /scene/gui
parent251e014b59d426f1b7a7d333c82669e7ebbc5bf5 (diff)
Fix #7011 ScrollContainer takes into account child's EXPAND flag when scrolling is enabled
(cherry picked from commit e9316a009e08e8fe9aa961a0ccef2a77ba7133fc)
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/scroll_container.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp
index b3ed9b209a..46312933a7 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_in_tree())) {
+ if (!scroll_h || (!h_scroll->is_visible_in_tree() && 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_in_tree())) {
+ if (!scroll_v || (!v_scroll->is_visible_in_tree() && c->get_v_size_flags()&SIZE_EXPAND)) {
r.pos.y=0;
r.size.height=size.height;
if (c->get_v_size_flags()&SIZE_EXPAND)