mirror of
https://github.com/godotengine/godot.git
synced 2024-11-13 07:32:55 +00:00
Merge pull request #64800 from KoBeWi/split_hax
Handle child control size changes in SplitContainer
This commit is contained in:
commit
c3a8ec3cbb
@ -95,11 +95,16 @@ void SplitContainer::_resort() {
|
||||
no_offset_middle_sep = ms_first[axis];
|
||||
}
|
||||
|
||||
// Compute the final middle separation
|
||||
// Compute the final middle separation.
|
||||
middle_sep = no_offset_middle_sep;
|
||||
if (prev_no_offset_middle_sep != INT_MAX) {
|
||||
split_offset -= middle_sep - prev_no_offset_middle_sep;
|
||||
}
|
||||
prev_no_offset_middle_sep = 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);
|
||||
middle_sep = MAX(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) - no_offset_middle_sep);
|
||||
middle_sep += clamped_split_offset;
|
||||
if (should_clamp_split_offset) {
|
||||
split_offset = clamped_split_offset;
|
||||
should_clamp_split_offset = false;
|
||||
|
@ -47,6 +47,7 @@ private:
|
||||
bool should_clamp_split_offset = false;
|
||||
int split_offset = 0;
|
||||
int middle_sep = 0;
|
||||
int prev_no_offset_middle_sep = INT_MAX;
|
||||
bool vertical = false;
|
||||
bool dragging = false;
|
||||
int drag_from = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user