Generation

generate functionWed, 25 Jan 2023

передвигать элемент при зажатие мыши

function onMouseDown(event) { var hitResult = project.hitTest(event.point, hitOptions); if (!hitResult) return; if (event.modifiers.shift) { if (hitResult.type == 'segment') { hitResult.segment.remove(); }; return; } if (hitResult) { dragHandle = hitResult.item; } } function onMouseDrag(event) { if (dragHandle) { dragHandle.position += event.delta; } } function onMouseUp(event) { dragHandle = null; }

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant