(stagePosition: StageDefinition)
| 90 | } |
| 91 | |
| 92 | function renderOverlay(stagePosition: StageDefinition) { |
| 93 | const overlaySvg = getState("__overlaySvg"); |
| 94 | |
| 95 | // TODO: cancel rendering if element is not visible |
| 96 | if (!overlaySvg) { |
| 97 | mountOverlay(stagePosition); |
| 98 | |
| 99 | return; |
| 100 | } |
| 101 | |
| 102 | const pathElement = overlaySvg.firstElementChild as SVGPathElement | null; |
| 103 | if (pathElement?.tagName !== "path") { |
| 104 | throw new Error("no path element found in stage svg"); |
| 105 | } |
| 106 | |
| 107 | pathElement.setAttribute("d", generateStageSvgPathString(stagePosition)); |
| 108 | } |
| 109 | |
| 110 | function createOverlaySvg(stage: StageDefinition): SVGSVGElement { |
| 111 | const windowX = window.innerWidth; |
no test coverage detected
searching dependent graphs…