fix: ghost overlap use inclusive boundary for adjacent items
Changed itemEndBeat <= windowStartBeat → < and noteAbsEnd <= windowStartBeat → < so abutting items (Item 1 ends at bar 1, Item 2 starts at bar 1) show ghost notes from the adjacent item.
This commit is contained in:
@@ -32,7 +32,7 @@
|
|||||||
var itemStartBeat = item.startTime / secondsPerBeat;
|
var itemStartBeat = item.startTime / secondsPerBeat;
|
||||||
var itemEndBeat = (item.startTime + item.duration) / secondsPerBeat;
|
var itemEndBeat = (item.startTime + item.duration) / secondsPerBeat;
|
||||||
|
|
||||||
if (itemStartBeat >= windowEndBeat || itemEndBeat <= windowStartBeat) continue;
|
if (itemStartBeat >= windowEndBeat || itemEndBeat < windowStartBeat) continue;
|
||||||
|
|
||||||
var notes = item.notes || [];
|
var notes = item.notes || [];
|
||||||
for (var k = 0; k < notes.length; k++) {
|
for (var k = 0; k < notes.length; k++) {
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
var noteAbsStart = itemStartBeat + (note.start_beat || 0);
|
var noteAbsStart = itemStartBeat + (note.start_beat || 0);
|
||||||
var noteAbsEnd = noteAbsStart + (note.duration_beats || 1);
|
var noteAbsEnd = noteAbsStart + (note.duration_beats || 1);
|
||||||
|
|
||||||
if (noteAbsStart >= windowEndBeat || noteAbsEnd <= windowStartBeat) continue;
|
if (noteAbsStart >= windowEndBeat || noteAbsEnd < windowStartBeat) continue;
|
||||||
|
|
||||||
var clampedStart = Math.max(noteAbsStart, windowStartBeat);
|
var clampedStart = Math.max(noteAbsStart, windowStartBeat);
|
||||||
var clampedEnd = Math.min(noteAbsEnd, windowEndBeat);
|
var clampedEnd = Math.min(noteAbsEnd, windowEndBeat);
|
||||||
|
|||||||
Reference in New Issue
Block a user