File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
packages/ui/src/components Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 570
570
.filter ((separ ) => separ .float !== undefined && ! hasSep .includes (separ .float ))
571
571
.map ((separ ) => separ .float )
572
572
const reverseSep = [... separators ].reverse ()
573
- let ind: number = 0
574
573
reverseSep .forEach ((separ , i ) => {
575
574
const pass = excluded .includes (separ .float )
576
575
if (diff > 0 && ! pass && separators != null ) {
577
- const box = rects .get (reverseSep .length - ind - 1 )
576
+ const originalIndex = separators .length - 1 - i
577
+ const box = rects .get (originalIndex - excluded .filter ((_ , idx ) => idx <= originalIndex ).length )
578
578
if (box != null ) {
579
579
const minSize: number = remToPx (separ .minSize === ' auto' ? 20 : separ .minSize )
580
- const forCrop = box .size - minSize
581
- if (forCrop > 0 ) {
582
- const newSize = forCrop - diff < 0 ? minSize : box .size - diff
583
- diff -= forCrop
580
+ const availableForCrop = box .size - minSize
581
+ if (availableForCrop > 0 ) {
582
+ const actualCrop = Math .min (diff , availableForCrop )
583
+ const newSize = box .size - actualCrop
584
+ diff -= actualCrop
584
585
if (separ .maxSize !== ' auto' ) {
585
586
if (direction === ' horizontal' ) {
586
587
box .element .style .width = ` ${newSize }px `
592
593
box .element .style .maxHeight = ` ${newSize }px `
593
594
}
594
595
}
595
- separators [separators . length - i - 1 ].size = newSize
596
+ separators [originalIndex ].size = pxToRem ( newSize )
596
597
}
597
598
}
598
- ind ++
599
599
}
600
600
})
601
601
}
You can’t perform that action at this time.
0 commit comments