From 4d4400a34c13b30c773046a29eb547e7a337098e Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Thu, 18 Apr 2024 00:14:01 +0200 Subject: [PATCH] Fixed selection bug --- source/funkin/editors/stage/StageEditor.hx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/source/funkin/editors/stage/StageEditor.hx b/source/funkin/editors/stage/StageEditor.hx index 6bb54a80..622a5920 100644 --- a/source/funkin/editors/stage/StageEditor.hx +++ b/source/funkin/editors/stage/StageEditor.hx @@ -420,6 +420,8 @@ class StageEditor extends UIState { updateZoom(); } + var prevMode = mouseMode; + // TODO: make this work with multiple selections if(selection.length == 1) { for(sprite in selection) { @@ -434,11 +436,12 @@ class StageEditor extends UIState { // openContextMenu(topMenu[2].childs); //} - if (mouseMode == NONE) { + if (mouseMode == NONE && prevMode == NONE) { if (FlxG.mouse.pressed) { - var pos = [FlxG.mouse.deltaScreenX, FlxG.mouse.deltaScreenY]; - movedTillRel.x += pos[0]; movedTillRel.y += pos[1]; - nextScroll.set(nextScroll.x - pos[0], nextScroll.y - pos[1]); + var x = FlxG.mouse.deltaScreenX; + var y = FlxG.mouse.deltaScreenY; + movedTillRel.x += x; movedTillRel.y += y; + nextScroll.set(nextScroll.x - x, nextScroll.y - y); currentCursor = HAND; }