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

Function wireZoomButtons

static/js/transport.js:375–396  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

373}
374
375function wireZoomButtons() {
376 if (waveScroll) {
377 let rafId = null;
378 const ro = new ResizeObserver(() => {
379 if (!multitrack || totalDuration <= 0) return;
380 if (rafId) cancelAnimationFrame(rafId);
381 rafId = requestAnimationFrame(() => { rafId = null; applyWaveZoom(); });
382 });
383 ro.observe(waveScroll);
384 }
385 if (waveScroll) {
386 waveScroll.addEventListener("wheel", (e) => {
387 if (waveScroll.scrollWidth <= waveScroll.clientWidth) return;
388 if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) {
389 e.preventDefault();
390 waveScroll.scrollLeft += e.deltaY;
391 }
392 }, { passive: false });
393 waveScroll.addEventListener("scroll", syncRulerScroll, { passive: true });
394 }
395 applyWaveZoom();
396}
397
398// Keep the mixer column and the waveform area scrolled in lockstep so stem
399// controls stay aligned with their lanes when the stack overflows (#159).

Callers 1

wireTransportButtonsFunction · 0.85

Calls 1

applyWaveZoomFunction · 0.85

Tested by

no test coverage detected