From bcb5a528ae3d9eac5531fc91252d8a64357adaca Mon Sep 17 00:00:00 2001 From: jiannibang <271381693@qq.com> Date: Wed, 24 Jul 2024 18:31:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=AE=AD=E5=A4=B4=E6=96=B9=E5=90=91?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/root/getters.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/store/root/getters.js b/src/store/root/getters.js index 8e41bbd..381c693 100644 --- a/src/store/root/getters.js +++ b/src/store/root/getters.js @@ -37,9 +37,10 @@ export const currentFloorShopMap = ({ currentFloor: device, shopList, mapData }) const result = {} try { const xaxis = JSON.parse(shop.xaxis).map(Number) - let angle = (Math.atan2(deviceY - xaxis[2], xaxis[0] - deviceX) / Math.PI) * 180 - device.angle + let angle = (Math.atan2(deviceY - xaxis[2], xaxis[0] - deviceX) / Math.PI) * 180 + device.angle if (angle < 0) angle += 360 if (angle > 360) angle -= 360 + console.log(angle) angle = (angle / 180) * Math.PI result.distance = Math.ceil(getDistance({ x: deviceX, y: deviceY }, { x: xaxis[0], y: xaxis[2] }) / building.scale)