| | |
| | | if (!this.mapContainer || !this.app) { |
| | | return; |
| | | } |
| | | |
| | | this.mapContainer.scale.set(1); |
| | | this.mapContainer.position.set(0, 0); |
| | | if (this.mapContainer.children.length === 0) { |
| | | return; |
| | | } |
| | | this.mapContainer.scale.set(1); |
| | | this.mapContainer.position.set(0, 0); |
| | | |
| | | let minX, maxX, minY, maxY; |
| | | for (let sprite of this.mapContainer.children) { |
| | |
| | | } |
| | | |
| | | this.scale = Math.min( |
| | | this.app.renderer.width / (maxX - minX) * 0.8, |
| | | this.app.renderer.height / (maxY - minY) * 0.8 |
| | | this.app.renderer.width / (maxX - minX) * 0.5, |
| | | this.app.renderer.height / (maxY - minY) * 0.5 |
| | | ); |
| | | |
| | | let centerPoint = { |