From c4a368aeb900ab0bf392866787b149ffb6eb384c Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期三, 06 三月 2024 09:46:37 +0800
Subject: [PATCH] #

---
 zy-asrs-flow/src/pages/map/player.js |   54 +++---------------------------------------------------
 1 files changed, 3 insertions(+), 51 deletions(-)

diff --git a/zy-asrs-flow/src/pages/map/player.js b/zy-asrs-flow/src/pages/map/player.js
index 09e1f72..09fd952 100644
--- a/zy-asrs-flow/src/pages/map/player.js
+++ b/zy-asrs-flow/src/pages/map/player.js
@@ -107,57 +107,9 @@
 
 
                 // batch move
-                Utils.spriteListBeMovable(this.selectedSprites, this.scale, this.activateMapEvent);
-                // if (this.selectedSprites && this.selectedSprites.length > 0) {
-                //     let batchMove = false;
-                //     let batchMoveStartPos = null;
-
-                //     const batchMoving = (event) => {
-                //         if (batchMove) {
-                //             // offset move val
-                //             var mouseMovement = {
-                //                 x: (event.global.x - batchMoveStartPos.x) / this.scale,
-                //                 y: (event.global.y - batchMoveStartPos.y) / this.scale
-                //             };
-                //             for (let sprite of this.selectedSprites) {
-                //                 sprite.position.x = sprite.data.batchMoveStartPos.x + mouseMovement.x;
-                //                 sprite.position.y = sprite.data.batchMoveStartPos.y + mouseMovement.y;
-                //             }
-                //         }
-                //     }
-
-                //     const batchMoveEnd = (event) => {
-                //         batchMove = false;
-                //         batchMoveStartPos = null;
-                //         this.selectedSprites.forEach(child => {
-                //             Utils.unMarkSprite(child);
-                //         })
-                //         this.selectedSprites = [];
-                //         this.mapContainer.parent.off('mousedown');
-                //         this.mapContainer.parent.off('mousemove');
-
-                //         this.activateMapEvent(Utils.MapEvent.SELECTION_BOX);
-                //     }
-
-                //     const batchMoveStart = (event) => {
-                //         batchMoveStartPos = { x: event.data.global.clone().x, y: event.data.global.clone().y };
-                //         this.selectedSprites.forEach(child => {
-                //             child.data.batchMoveStartPos = { x: child.position.x, y: child.position.y };
-                //         })
-
-                //         batchMove = true;
-                //         this.mapContainer.parent.off('mousemove');
-                //         this.mapContainer.parent.on('mousemove', batchMoving);
-
-                //         this.mapContainer.parent.off('mouseup');
-                //         this.mapContainer.parent.on('mouseup', batchMoveEnd);
-                //     }
-
-                //     this.mapContainer.parent.off('mousedown')
-                //     this.mapContainer.parent.on('mousedown', batchMoveStart);
-                // }
-
-
+                Utils.spriteListBeMovable(this.selectedSprites, this.scale, () => {
+                    this.activateMapEvent(Utils.MapEvent.SELECTION_BOX);
+                });
 
             }
 

--
Gitblit v1.9.1