()
| 2338 | }, [closeControlSocket]); |
| 2339 | |
| 2340 | function beginZoomAnimation() { |
| 2341 | setZoomAnimating(true); |
| 2342 | if (zoomAnimationTimeoutRef.current) { |
| 2343 | clearTimeout(zoomAnimationTimeoutRef.current); |
| 2344 | } |
| 2345 | zoomAnimationTimeoutRef.current = window.setTimeout(() => { |
| 2346 | setZoomAnimating(false); |
| 2347 | zoomAnimationTimeoutRef.current = 0; |
| 2348 | }, ZOOM_ANIMATION_MS); |
| 2349 | } |
| 2350 | |
| 2351 | function applyZoom(nextScale: number, nextPan?: Point, animate = true) { |
| 2352 | const panForClamp = nextPan ?? { |
no test coverage detected