devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
21 lines (20 loc) • 579 B
JavaScript
export class ColumnIntervalWidthIterator {
constructor(columnsInfo) {
this.columnsInfo = columnsInfo;
this.intervalIndex = 0;
this.interval = columnsInfo[0];
}
endOfIntervals() {
return !this.interval;
}
moveNext() {
this.intervalIndex++;
this.interval = this.columnsInfo[this.intervalIndex];
}
advance(interval) {
if (this.interval.colSpan == interval.colSpan)
this.moveNext();
else
this.interval = this.interval.substract(interval);
}
}