| 54 | const overlapArea = (a: ScreenRect, b: ScreenRect) => Math.max(0, Math.min(a.right, b.right) - Math.max(a.left, b.left)) |
| 55 | * Math.max(0, Math.min(a.bottom, b.bottom) - Math.max(a.top, b.top)); |
| 56 | const inside = (rect: ScreenRect, bounds: ScreenRect) => rect.left >= bounds.left && rect.right <= bounds.right && rect.top >= bounds.top && rect.bottom <= bounds.bottom; |
| 57 | const CENTRED: ReadonlySet<MarkerNameSlot> = new Set(['below', 'above', 'below-2', 'above-2']); |
| 58 | /* Ein Name ueber oder unter seinem Ring rueckt seitlich in die Zeichenflaeche, solange er den Ring noch ueberspannt. */ |
| 59 | function nudged(marker: MarkerName, slot: MarkerNameSlot, bounds: ScreenRect): ScreenRect { |