(nextScale: number, nextPan?: Point, animate = true)
| 2349 | } |
| 2350 | |
| 2351 | function applyZoom(nextScale: number, nextPan?: Point, animate = true) { |
| 2352 | const panForClamp = nextPan ?? { |
| 2353 | x: panRef.current.x, |
| 2354 | y: panRef.current.y + autoViewportOffsetY, |
| 2355 | }; |
| 2356 | const clampedScale = clampZoom(nextScale, fitScale); |
| 2357 | const clampedPan = clampPan( |
| 2358 | panForClamp, |
| 2359 | clampedScale, |
| 2360 | canvasSize, |
| 2361 | effectiveDeviceNaturalSize, |
| 2362 | viewportChromeProfile, |
| 2363 | viewportRotationQuarterTurns, |
| 2364 | zoomDockReservedHeight, |
| 2365 | ); |
| 2366 | effectiveZoomRef.current = clampedScale; |
| 2367 | panRef.current = clampedPan; |
| 2368 | if (animate) { |
| 2369 | beginZoomAnimation(); |
| 2370 | } |
| 2371 | setViewMode("manual"); |
| 2372 | setZoom(clampedScale); |
| 2373 | setPan(clampedPan); |
| 2374 | } |
| 2375 | |
| 2376 | function applyZoomAtClientPoint( |
| 2377 | nextScale: number, |
no test coverage detected