()
| 389 | }; |
| 390 | |
| 391 | const recreateCoordinator = (): void => { |
| 392 | if (!gpuContext) return; |
| 393 | const prevZoom = coordinator?.getZoomRange() ?? null; |
| 394 | |
| 395 | coordinator?.dispose(); |
| 396 | coordinator = createRenderCoordinator(gpuContext, resolvedOptions, { |
| 397 | onRequestRender: requestRender, |
| 398 | }); |
| 399 | coordinatorTargetFormat = gpuContext.preferredFormat; |
| 400 | |
| 401 | // Best-effort preserve zoom window. |
| 402 | if (prevZoom) coordinator.setZoomRange(prevZoom.start, prevZoom.end); |
| 403 | |
| 404 | unsubscribeZoom?.(); |
| 405 | unsubscribeZoom = coordinator.onZoomRangeChange((r) => { |
| 406 | zoomRange = { start: r.start, end: r.end }; |
| 407 | }); |
| 408 | zoomRange = coordinator.getZoomRange(); |
| 409 | |
| 410 | syncSliderUi(); |
| 411 | }; |
| 412 | |
| 413 | // Coalesced resize observer (keeps canvas backing size in sync without DOM thrash). |
| 414 | const ro = (() => { |
no test coverage detected