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:
2026-07-27 19:31:36 +07:00
parent db45efe53c
commit 1628a34ea0
+2 -2
View File
@@ -32,7 +32,7 @@
var itemStartBeat = item.startTime / secondsPerBeat;
var itemEndBeat = (item.startTime + item.duration) / secondsPerBeat;
if (itemStartBeat >= windowEndBeat || itemEndBeat <= windowStartBeat) continue;
if (itemStartBeat >= windowEndBeat || itemEndBeat < windowStartBeat) continue;
var notes = item.notes || [];
for (var k = 0; k < notes.length; k++) {
@@ -40,7 +40,7 @@
var noteAbsStart = itemStartBeat + (note.start_beat || 0);
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 clampedEnd = Math.min(noteAbsEnd, windowEndBeat);