antoniandre / splitpanes

A Vue 3 (and 2) reliable, simple and touch-ready panes splitter / resizer.
https://antoniandre.github.io/splitpanes
MIT License
1.89k stars 168 forks source link

Bug in calculating space to allocate, there's sometimes remaining space even though sizes total is 100 #194

Open queen3 opened 1 year ago

queen3 commented 1 year ago

The method equalizeAfterAddOrRemove initializes let leftToAllocate = 0 and then subtracts as leftToAllocate -= pane.size.

This results in leftToAllocate to be always negative (usually -100) and thus it is always considered that there's something to allocate, which leads to strange cases when there's empty unallocated space (on the right).

The proper initialization is leftToAllocate = 100.