using floating point comparisons

This commit is contained in:
Yotam Mann 2019-11-18 15:16:04 -05:00
parent abee380fc2
commit e0248afb1c

View file

@ -84,7 +84,7 @@ export class Timeline<GenericEvent extends TimelineEvent> extends Tone {
event.time = event.time.valueOf();
if (this.increasing && this.length) {
const lastValue = this._timeline[this.length - 1] as GenericEvent;
this.assert(lastValue.time <= event.time, "The time must be greater than or equal to the last scheduled time");
this.assert(GTE(event.time, lastValue.time), "The time must be greater than or equal to the last scheduled time");
this._timeline.push(event);
} else {
const index = this._search(event.time);