(center, factor)
| 700 | coordinator?.setZoomRange(start, end); |
| 701 | }; |
| 702 | const zoomIn: ZoomState['zoomIn'] = (center, factor) => { |
| 703 | if (!Number.isFinite(center) || !Number.isFinite(factor) || factor <= 1) return; |
| 704 | const r = coordinator?.getZoomRange(); |
| 705 | if (!r) return; |
| 706 | const c = clamp(center, 0, 100); |
| 707 | const ratio = computeZoomInOutAnchorRatio(r, c); |
| 708 | const span = r.end - r.start; |
| 709 | const nextSpan = span / factor; |
| 710 | const nextStart = c - ratio * nextSpan; |
| 711 | coordinator?.setZoomRange(nextStart, nextStart + nextSpan); |
| 712 | }; |
| 713 | const zoomOut: ZoomState['zoomOut'] = (center, factor) => { |
| 714 | if (!Number.isFinite(center) || !Number.isFinite(factor) || factor <= 1) return; |
| 715 | const r = coordinator?.getZoomRange(); |
nothing calls this directly
no test coverage detected