From 7f70cb15d035f0c233b9e62b9e43aa985317c908 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期一, 04 十一月 2024 10:22:45 +0800
Subject: [PATCH] #

---
 zy-acs-flow/src/map/tool.js |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/zy-acs-flow/src/map/tool.js b/zy-acs-flow/src/map/tool.js
index aa0c56e..2993d4e 100644
--- a/zy-acs-flow/src/map/tool.js
+++ b/zy-acs-flow/src/map/tool.js
@@ -348,7 +348,7 @@
 
 function onSpriteMouseOver(event) {
     if (tooltip) {
-        app.stage.removeChild(tooltip);
+        app?.stage.removeChild(tooltip);
     }
     tooltip = createSpriteTooltip(this);// this => sprite
     tooltip.x = event.data.global.x + 10;
@@ -365,7 +365,7 @@
 
 function onSpriteMouseOut() {
     if (tooltip && tooltip.parent) {
-        tooltip.parent.removeChild(tooltip);
+        tooltip.parent?.removeChild(tooltip);
         tooltip = null;
     }
 }
@@ -478,7 +478,7 @@
         effectTicker = null;
     }
     if (effectCircle) {
-        mapContainer.removeChild(effectCircle);
+        mapContainer?.removeChild(effectCircle);
         effectCircle = null;
     }
     selectedSprite = null;
@@ -555,6 +555,9 @@
 
     // diff
     let rotationDifference = targetRotation - currentRotation;
+    if (rotationDifference === 0) {
+        return;
+    }
     rotationDifference = ((rotationDifference + Math.PI) % (2 * Math.PI)) - Math.PI;
 
     // destination

--
Gitblit v1.9.1