| 300 | // Selbstschleife an der letzten Spalte ausserhalb des Bildes. |
| 301 | let rightMost = columns - DIAGRAM_PAD_X; |
| 302 | const rightEdge = (x: number, text: string, anchor: 'start' | 'middle' | 'end'): number => { |
| 303 | const width = text.length * DIAGRAM_LABEL_CHAR_WIDTH; |
| 304 | if (anchor === 'start') { |
| 305 | return x + width; |
| 306 | } |
| 307 | return anchor === 'end' ? x : x + width / 2; |
| 308 | }; |
| 309 | for (const arrow of arrows) { |
| 310 | rightMost = Math.max(rightMost, rightEdge(arrow.labelX, arrow.label, arrow.labelAnchor)); |
| 311 | if (arrow.self) { |