fix: sweep select now covers all tracks
- Removed sweepTrackIdRef filter in mouseup handler: all tracks are scanned for intersecting items. - Removed track ID check from sweep overlay rendering: overlay appears on every track (not just drag-start track). - Fixed stale closure by adding sweepSelectRef.
This commit is contained in:
@@ -11903,14 +11903,12 @@ const App = () => {
|
|||||||
if (!isSweepingRef.current) return;
|
if (!isSweepingRef.current) return;
|
||||||
isSweepingRef.current = false;
|
isSweepingRef.current = false;
|
||||||
const sweep = sweepSelectRef.current;
|
const sweep = sweepSelectRef.current;
|
||||||
if (sweep && sweepTrackIdRef.current) {
|
if (sweep) {
|
||||||
const tId = sweepTrackIdRef.current;
|
|
||||||
const start = Math.min(sweep.startTime, sweep.endTime);
|
const start = Math.min(sweep.startTime, sweep.endTime);
|
||||||
const end = Math.max(sweep.startTime, sweep.endTime);
|
const end = Math.max(sweep.startTime, sweep.endTime);
|
||||||
const curTracks = activeTracksRef.current || [];
|
const curTracks = activeTracksRef.current || [];
|
||||||
const found = new Set();
|
const found = new Set();
|
||||||
curTracks.forEach(t => {
|
curTracks.forEach(t => {
|
||||||
if (t.id !== tId) return;
|
|
||||||
(t.midiItems || []).forEach(m => {
|
(t.midiItems || []).forEach(m => {
|
||||||
if (m.startTime < end && m.startTime + m.duration > start) {
|
if (m.startTime < end && m.startTime + m.duration > start) {
|
||||||
found.add(m.id);
|
found.add(m.id);
|
||||||
@@ -16536,7 +16534,7 @@ const App = () => {
|
|||||||
}), /*#__PURE__*/React.createElement("div", {
|
}), /*#__PURE__*/React.createElement("div", {
|
||||||
className: "absolute -right-[1px] top-0 bottom-0 w-[2px] bg-amber-400 z-30 pointer-events-auto cursor-ew-resize",
|
className: "absolute -right-[1px] top-0 bottom-0 w-[2px] bg-amber-400 z-30 pointer-events-auto cursor-ew-resize",
|
||||||
onMouseDown: e => handleHandleDragStart(e, 'right')
|
onMouseDown: e => handleHandleDragStart(e, 'right')
|
||||||
})), sweepSelect && sweepTrackIdRef.current === track.id && /*#__PURE__*/React.createElement("div", {
|
})), sweepSelect && /*#__PURE__*/React.createElement("div", {
|
||||||
className: "absolute top-0 bottom-0 border-l border-r border-amber-400 bg-amber-500/10 z-20 pointer-events-none",
|
className: "absolute top-0 bottom-0 border-l border-r border-amber-400 bg-amber-500/10 z-20 pointer-events-none",
|
||||||
style: {
|
style: {
|
||||||
left: `${Math.min(sweepSelect.startTime, sweepSelect.endTime) * zoom}px`,
|
left: `${Math.min(sweepSelect.startTime, sweepSelect.endTime) * zoom}px`,
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user