diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-23 10:28:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 10:28:09 +0200 |
commit | 11506eb24d65cf7f7c3c279ae191d72924e7af03 (patch) | |
tree | c2770eacaa44aa745f67d672a637814ae2060edf /scene/gui | |
parent | b9919fd87dbac180f2d3ade766a8d074d4224dfe (diff) | |
parent | 185b1a5bd333c5e75da5219e66cb759b5e6c3684 (diff) |
Merge pull request #64676 from KoBeWi/split_and_conquer
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/split_container.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp index d7aa516ee6..9505a30540 100644 --- a/scene/gui/split_container.cpp +++ b/scene/gui/split_container.cpp @@ -98,11 +98,10 @@ void SplitContainer::_resort() { // Compute the final middle separation 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; + int clamped_split_offset = CLAMP(split_offset, ms_first[axis] - no_offset_middle_sep, get_size()[axis] - ms_second[axis] - sep); + middle_sep = MAX(middle_sep, clamped_split_offset); if (should_clamp_split_offset) { split_offset = clamped_split_offset; - should_clamp_split_offset = false; } } |