ui/move: fix bug, when long press without moving

This commit is contained in:
Johannes Kirschbauer
2025-09-03 21:40:46 +02:00
parent 629ef65ce5
commit afd7bfc8c0

View File

@@ -564,8 +564,13 @@ export function CubeScene(props: {
controls.enabled = false; controls.enabled = false;
// Change cursor to grabbing // Change cursor to grabbing
// LongPress, if not canceled, enters move mode
const cancelMove = setTimeout(() => { const cancelMove = setTimeout(() => {
setIsDragging(true); 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 // Set machine as flying
setHighlightGroups({ move: new Set(machines) }); setHighlightGroups({ move: new Set(machines) });