fix: remove grab handle e.stopPropagation blocking ruler clicks
This commit is contained in:
@@ -5968,29 +5968,6 @@ const beatSec = 60.0 / (parseInt(bpm) || 120);
|
|||||||
document.addEventListener('mousemove', onMove);
|
document.addEventListener('mousemove', onMove);
|
||||||
document.addEventListener('mouseup', onUp);
|
document.addEventListener('mouseup', onUp);
|
||||||
}
|
}
|
||||||
}), React.createElement("div", {
|
|
||||||
style: { position: 'absolute', left: '4px', right: '4px', top: 0, bottom: 0, cursor: 'move' },
|
|
||||||
onMouseDown: (e) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
const startBeat = loopStartBeat;
|
|
||||||
const range = loopEndBeat - loopStartBeat;
|
|
||||||
const offsetBeat = startBeat + range / 2;
|
|
||||||
const onMove = (ev) => {
|
|
||||||
const r = rulerScrollRef.current;
|
|
||||||
if (!r) return;
|
|
||||||
const rRect = r.getBoundingClientRect();
|
|
||||||
const bx = ev.clientX - rRect.left + r.scrollLeft;
|
|
||||||
const centerBeat = getSnapBeat(bx / pixelsPerBeat, snapVal);
|
|
||||||
const halfRange = range / 2;
|
|
||||||
const newStart = Math.max(0, centerBeat - halfRange);
|
|
||||||
setLoopStartBeat(newStart);
|
|
||||||
setLoopEndBeat(newStart + range);
|
|
||||||
setSubTabs(prev => prev.map(s => s.id === st.id ? { ...s, selectionStart: newStart * beatSec, selectionEnd: (newStart + range) * beatSec } : s));
|
|
||||||
};
|
|
||||||
const onUp = () => { document.removeEventListener('mousemove', onMove); document.removeEventListener('mouseup', onUp); };
|
|
||||||
document.addEventListener('mousemove', onMove);
|
|
||||||
document.addEventListener('mouseup', onUp);
|
|
||||||
}
|
|
||||||
}))))),
|
}))))),
|
||||||
|
|
||||||
/* 3. MAIN PIANO ROLL GRID (KEYBOARD + CANVAS) */
|
/* 3. MAIN PIANO ROLL GRID (KEYBOARD + CANVAS) */
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user