From d71bf49951b25e322b61aeb31f875002f6b59cbc Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 02 三月 2024 17:01:50 +0800
Subject: [PATCH] #
---
zy-asrs-flow/src/pages/map/components/edit.jsx | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/zy-asrs-flow/src/pages/map/components/edit.jsx b/zy-asrs-flow/src/pages/map/components/edit.jsx
index aea4a97..e83ff62 100644
--- a/zy-asrs-flow/src/pages/map/components/edit.jsx
+++ b/zy-asrs-flow/src/pages/map/components/edit.jsx
@@ -7,14 +7,13 @@
const Edit = (props) => {
const [dragging, setDragging] = useState(false);
- const [dragImage, setDragImage] = useState(null);
-
+ const [dragSprite, setDragSprite] = useState(null);
+
useEffect(() => {
const handleMouseMove = (e) => {
if (dragging) {
- props.onDrop(e.clientX, e.clientY);
+ props.onDrop(dragSprite, e.clientX, e.clientY);
setDragging(false);
- props.onCancel();
}
};
window.addEventListener('mousemove', handleMouseMove);
@@ -23,6 +22,10 @@
const onDragStart = (e) => {
setDragging(true)
+ props.onCancel();
+ const sprite = PIXI.Sprite.from(agv);
+ sprite.anchor.set(0.5);
+ setDragSprite(sprite);
};
return (
--
Gitblit v1.9.1