fix: multi-item drag mousemove didn't handle clips

The multi-item drag mousemove handler only processed
info.type === 'section' and 'midiItem'. Added 'clip' support
(midClips slice + findIndex + update).
This commit is contained in:
2026-07-27 22:32:11 +07:00
parent 1ca2ec6d01
commit 1dbece1fc7
2 changed files with 6 additions and 2 deletions
+5 -1
View File
@@ -11818,6 +11818,7 @@ const App = () => {
var delta = newStart - dragOrigStart;
var midSections = (t.sections || []).slice();
var midMidis = (t.midiItems || []).slice();
var midClips = (t.clips || []).slice();
Object.keys(drag.multiIds).forEach(function(mid) {
var info = drag.multiIds[mid];
var newVal = info.start + delta;
@@ -11827,9 +11828,12 @@ const App = () => {
} else if (info.type === 'midiItem') {
var idx = midMidis.findIndex(function(m) { return m.id === mid; });
if (idx >= 0) midMidis[idx] = { ...midMidis[idx], startTime: Math.max(0, newVal) };
} else if (info.type === 'clip') {
var idx = midClips.findIndex(function(c) { return c.id === mid; });
if (idx >= 0) midClips[idx] = { ...midClips[idx], startTime: Math.max(0, newVal) };
}
});
return { ...t, sections: midSections, midiItems: midMidis };
return { ...t, sections: midSections, midiItems: midMidis, clips: midClips };
}
const items = drag.itemType === 'section' ? (t.sections || []) : (t.midiItems || []);
const updatedItems = items.filter(it => it.id !== drag.itemId);