Merge pull request #24106 from groud/fix_split_container

Fixes collapsed SplitContainers
This commit is contained in:
Rémi Verschelde 2018-12-02 21:19:44 +01:00 committed by GitHub
commit f86013082e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {