Open widmoser opened 8 years ago
It's also bugging out when dragging even within that 40% range.
I started looking into this issue and at first my idea was to just add another if
to limit the auto distributed size to the respective maximum or ensuring the minimum if set. The problem that arises though is that it is not so easy any more to distribute the remaining space if there are more than one auto-sized container. So I came up with the following algorithm:
0
if it has no minimum size)Unless the sum of all min sizes is greater or the sum of all max sizes smaller than the total size of the container this should distribute the space in a useful manner.
I can upload what I have done so far into a PR, but currently the tests are not passing because the pixel size is not always exactly correct (varying about 1 or 2 pixels).
Thinking of #162 another option would be to completely rethink the layouting approach and solve everything at once.
Consider the following plunker with a ui-layout with two containers. The
max-size
of the left container is set to40%
. The start position of the split bar is at50%
though. As soon as the split bar is moved, it is assigned the correct position of40%
resulting in a jump.