(duration = 200)
| 2409 | } |
| 2410 | |
| 2411 | zoomIn(duration = 200): void { |
| 2412 | // Mark this as a user-driven zoom so the auto-fit follower |
| 2413 | // doesn't yank the camera back to fit-bounds on the next worker |
| 2414 | // tick (Fix #39). Also clear any pending follower target so it |
| 2415 | // doesn't fight the animation. |
| 2416 | this.hasUserMovedCamera = true; |
| 2417 | this.autoFitTarget = null; |
| 2418 | const target: Viewport = { |
| 2419 | x: this.vp.x, |
| 2420 | y: this.vp.y, |
| 2421 | scale: this.vp.scale * 1.5, |
| 2422 | }; |
| 2423 | this.cancelAnimation?.(); |
| 2424 | this.cancelAnimation = animateViewport( |
| 2425 | this.vp, |
| 2426 | target, |
| 2427 | duration, |
| 2428 | (vp) => { |
| 2429 | this.vp = vp; |
| 2430 | }, |
| 2431 | () => { |
| 2432 | this.redrawAllEdges(); |
| 2433 | this.cancelAnimation = null; |
| 2434 | }, |
| 2435 | ); |
| 2436 | } |
| 2437 | |
| 2438 | zoomOut(duration = 200): void { |
| 2439 | this.hasUserMovedCamera = true; |
no test coverage detected