(e, surface)
| 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; |
no test coverage detected