MCPcopy
hub / github.com/stemdeckapp/stemdeck / startDrag

Function startDrag

static/js/transport.js:266–281  ·  view source on GitHub ↗
(e, surface)

Source from the content-addressed store, hash-verified

264 let moved = false;
265
266 const startDrag = (e, surface) => {
267 if (e.button !== 0 || e.target.closest(".loop-region")) return;
268 const t = timeFromClientX(e.clientX);
269 if (t === null) return;
270 dragging = true;
271 activePointerId = e.pointerId;
272 moved = false;
273 dragStartTime = t;
274 setLoopStart(t);
275 setLoopEnd(t);
276 setLoopEnabled(true);
277 loopBtn.classList.add("active");
278 updateLoopRegionVisual();
279 surface.setPointerCapture(e.pointerId);
280 e.preventDefault();
281 };
282
283 const moveDrag = (e) => {
284 if (!dragging || e.pointerId !== activePointerId) return;

Callers 1

wireLoopDragFunction · 0.70

Calls 5

setLoopStartFunction · 0.90
setLoopEndFunction · 0.90
setLoopEnabledFunction · 0.90
timeFromClientXFunction · 0.85
updateLoopRegionVisualFunction · 0.85

Tested by

no test coverage detected