UNPKG

flash-section-list

Version:
24 lines (23 loc) 590 B
"use strict"; export default class LayoutManager { constructor({ horizontal, accuracy = 2 }) { this.horizontal = horizontal; this.accuracy = accuracy; } getSize(layout) { return this.horizontal ? layout?.width : layout?.height; } isChanged(a, b) { const sizeA = this.getSize(a); const sizeB = this.getSize(b); if (sizeA === undefined || sizeB === undefined) return true; return Math.abs(sizeA - sizeB) > this.accuracy; } getSizeProperty() { return this.horizontal ? 'width' : 'height'; } } //# sourceMappingURL=LayoutManager.js.map