From b6468c97166a649147c476767cfc78cd86ac9b41 Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期一, 11 三月 2024 08:38:20 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/utils.js | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/utils.js b/zy-asrs-flow/src/pages/map/utils.js
index dd542bd..3abb061 100644
--- a/zy-asrs-flow/src/pages/map/utils.js
+++ b/zy-asrs-flow/src/pages/map/utils.js
@@ -12,10 +12,10 @@
mapContainer = param;
}
-export const getRealPosition = (x, y) => {
+export const getRealPosition = (x, y, mapContainer) => {
const rect = app.view.getBoundingClientRect();
return {
- mapX: x - rect.left,
- mapY: y - rect.top
+ mapX: (x - rect.left) / mapContainer.scale.x - mapContainer.x / mapContainer.scale.x,
+ mapY: (y - rect.top) / mapContainer.scale.y - mapContainer.y / mapContainer.scale.y
}
}
\ No newline at end of file
--
Gitblit v1.9.1