From 45602bcbecc71c3ba53fdc918058262326edd5d5 Mon Sep 17 00:00:00 2001 From: dgflash Date: Tue, 15 Oct 2024 13:15:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=96=E6=8B=BD=E5=8A=9F=E8=83=BD=E5=85=BC?= =?UTF-8?q?=E5=AE=B9cc3.8.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/libs/extension/NodeDragExt.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/assets/libs/extension/NodeDragExt.ts b/assets/libs/extension/NodeDragExt.ts index bb531f8..b723e3b 100644 --- a/assets/libs/extension/NodeDragExt.ts +++ b/assets/libs/extension/NodeDragExt.ts @@ -68,7 +68,8 @@ if (!Node.prototype["__$NodeDragExt$__"]) { let delta = event.getUIDelta(); // /** 这里除以 世界缩放,在有缩放的时候拖拽不至于很怪 */ // this.position = this.position.add(v3(delta.x / this.worldScale.x, delta.y / this.worldScale.y, 0)); - this.position = this.position.add(v3(delta.x, delta.y, 0)); + let newPos = v3(delta.x, delta.y, 0).add(this.position); + this.position = newPos; this.emit(Node.DragEvent.DRAG_MOVE, event); } },