eclipse / elk

Eclipse Layout Kernel - Automatic layout for Java applications.
https://www.eclipse.org/elk/
Other
258 stars 86 forks source link

Fix always existing bug in model order port sorting. #1067

Closed soerendomroes closed 2 months ago

soerendomroes commented 3 months ago

Make sure that the order of incoming ports matches the order given by the previous layer.

Updated WEST side handling to fix the main issue. Moreover, there was a p1/p2 typo as well.

This also makes port model order non-constraining for input ports same as the edge model order. If one wants to constrain the port order one should use portConstraints.

soerendomroes commented 3 months ago

This shows the model I wanted to fix and the one I broke.

Apparently my bug only works for models were the edges originate from the same node.

soerendomroes commented 3 months ago

This does not seem to be everything. Somehow, this is different.

soerendomroes commented 3 months ago

https://github.com/eclipse/elk-models/pull/22 adds the correctness test as an example model.

Maybe check, whether I should add more concrete tests for all corner cases here. The test models in tests/layered/preserveOrder check all other cases while the basic correctness tests that check that big models have no corner cases left.

soerendomroes commented 2 months ago

Fixes #1065