summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-12-02 21:19:44 +0100
committerGitHub <noreply@github.com>2018-12-02 21:19:44 +0100
commitf86013082e0977bce151e9dbbcd1e5640deb3df1 (patch)
treeead94cc6e0e3b468a73d3b4ef5cc84ca60514d02
parentd8a28368f979f8ebe5c4f218613961b59ca5822d (diff)
parent136847e5c3623f1787af88188681accf717f96b9 (diff)
Merge pull request #24106 from groud/fix_split_container
Fixes collapsed SplitContainers
-rw-r--r--scene/gui/split_container.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index 3554f04cc0..c3265d3ed5 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -94,12 +94,15 @@ void SplitContainer::_resort() {
}
// Compute the final middle separation
- int clamped_split_offset = CLAMP(split_offset, ms_first[axis] - no_offset_middle_sep, (get_size()[axis] - ms_second[axis] - sep) - no_offset_middle_sep);
- middle_sep = no_offset_middle_sep + clamped_split_offset;
- if (!collapsed && should_clamp_split_offset) {
- split_offset = clamped_split_offset;
- _change_notify("split_offset");
- should_clamp_split_offset = false;
+ middle_sep = no_offset_middle_sep;
+ if (!collapsed) {
+ int clamped_split_offset = CLAMP(split_offset, ms_first[axis] - no_offset_middle_sep, (get_size()[axis] - ms_second[axis] - sep) - no_offset_middle_sep);
+ middle_sep += clamped_split_offset;
+ if (should_clamp_split_offset) {
+ split_offset = clamped_split_offset;
+ _change_notify("split_offset");
+ should_clamp_split_offset = false;
+ }
}
if (vertical) {