filter out event parts from draw

This commit is contained in:
Felix Roos 2022-03-13 11:20:57 +01:00
parent 04d14dea90
commit d5a928e6f7
2 changed files with 4 additions and 2 deletions

View file

@ -29,7 +29,9 @@ Pattern.prototype.draw = function (callback, cycleSpan, lookaheadCycles = 1) {
cycle = currentCycle;
const begin = currentCycle * cycleSpan;
const end = (currentCycle + lookaheadCycles) * cycleSpan;
events = this.add(0).query(new State(new TimeSpan(begin, end)));
events = this.add(0)
.query(new State(new TimeSpan(begin, end)))
.filter((event) => event.part.begin.valueOf() === event.whole.begin.valueOf());
}
}
callback(ctx, events, t, cycleSpan, time);