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.
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.