From afd7bfc8c01dce3d8c706c9bf537d943fa2d2f2f Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 3 Sep 2025 21:40:46 +0200 Subject: [PATCH] ui/move: fix bug, when long press without moving --- pkgs/clan-app/ui/src/scene/cubes.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/clan-app/ui/src/scene/cubes.tsx b/pkgs/clan-app/ui/src/scene/cubes.tsx index 504298955..c6b822059 100644 --- a/pkgs/clan-app/ui/src/scene/cubes.tsx +++ b/pkgs/clan-app/ui/src/scene/cubes.tsx @@ -564,8 +564,13 @@ export function CubeScene(props: { controls.enabled = false; // Change cursor to grabbing + // LongPress, if not canceled, enters move mode const cancelMove = setTimeout(() => { setIsDragging(true); + const pos = + machineManager.machines.get(machines[0])?.group.position || + new THREE.Vector3(0, 0, 0); + actionMachine?.position.set(pos.x, 0, pos.z); // Set machine as flying setHighlightGroups({ move: new Set(machines) });