eclipse-sprotty/sprotty

Label placement wrong with no Rotate and edgePlacement 'on'

MichelSc opened this issue · 1 comments

In the decoration flow for a label with EdgePlacement rotate = false and side = 'on', implemented by EdgeLayoutPostprocessor

  • method getAlignement calculates where to draw the label with respect to a point on the edge
  • in case of side='on', we move the label with the corner of the bounds to the middle of the bounds (OK)
  • for this, we need to add to x bounds.witdth (tobe=ok) and not bound.height (asis=nok).

See line

return { x: x + 0.5 * bounds.height, y: y + 0.5 * bounds.height};

Thanks for the hint!