Label placement calculations for segmented edges is not trivial. To look good, the middle label's position needs to depend on the geometry of the edge.
The label is centered on the middle segment if horizontal, and to the right and slightly offset from the middle if vertical.
However, when the diagram geometry results in a straight edge, this formula makes the label appear off-center
We need to detect when edges are straight (no middle segment) and position the edge intuitively in such cases.
Description
Label placement calculations for segmented edges is not trivial. To look good, the middle label's position needs to depend on the geometry of the edge.![image](https://github.com/prmr/JetUML/assets/6033492/e3c39392-bc52-4aab-b4a4-34fcd6c2e16b)
The label is centered on the middle segment if horizontal, and to the right and slightly offset from the middle if vertical.
However, when the diagram geometry results in a straight edge, this formula makes the label appear off-center
We need to detect when edges are straight (no middle segment) and position the edge intuitively in such cases.
Configuration