From d96ce786e1ed6ad4858decd0100bafc53528e8f4 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 16 三月 2024 14:43:00 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/player.js | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/player.js b/zy-asrs-flow/src/pages/map/player.js
index ac503af..5fff216 100644
--- a/zy-asrs-flow/src/pages/map/player.js
+++ b/zy-asrs-flow/src/pages/map/player.js
@@ -149,6 +149,9 @@
this.scale = 1;
this.app.view.addEventListener('wheel', (event) => {
event.preventDefault();
+ if (this.scale !== this.mapContainer.scale.x) {
+ this.scale = this.mapContainer.scale.x;
+ }
const delta = Math.sign(event.deltaY);
@@ -167,7 +170,6 @@
this.scale = newScale;
this.mapContainer.scale.set(this.scale);
- console.log(this.scale);
this.mapContainer.children.forEach(child => {
// child.scale.set(1 / this.scale); // 闃叉鍥炬爣鍙樺皬
@@ -326,11 +328,12 @@
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) {
--
Gitblit v1.9.1