()
| 2313 | } |
| 2314 | |
| 2315 | private computeFitTarget(): Viewport | null { |
| 2316 | if (this.nodes.size === 0) return null; |
| 2317 | const positions = Array.from(this.nodes.values()) |
| 2318 | .filter((n) => n.visible) |
| 2319 | .map((n) => |
| 2320 | this.mode3d |
| 2321 | ? { x: n.sprite.position.x, y: n.sprite.position.y } |
| 2322 | : { x: n.x, y: n.y }, |
| 2323 | ); |
| 2324 | if (positions.length === 0) return null; |
| 2325 | const bounds = computeBounds(positions); |
| 2326 | return fitBounds(bounds, this.width, this.height); |
| 2327 | } |
| 2328 | |
| 2329 | /** Pause auto-fit (Fix #9). Used during layoutMode transitions to |
| 2330 | * hold the camera steady before positions have actually moved. |
no test coverage detected