@xtia/timeline 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/internal/range.js CHANGED
@@ -97,7 +97,6 @@ export class TimelineRange extends RangeProgression {
97
97
  const [start, end] = range instanceof TimelineRange
98
98
  ? [range.startPosition, range.endPosition]
99
99
  : [range.position, range.position + range.duration];
100
- return Math.min(this.startPosition, this.endPosition) <= Math.max(start, end) &&
101
- Math.max(this.startPosition, this.endPosition) >= Math.min(start, end);
100
+ return this.startPosition <= end && this.endPosition >= start;
102
101
  }
103
102
  }
@@ -242,15 +242,17 @@ export class Timeline {
242
242
  });
243
243
  }
244
244
  seekRanges(to) {
245
- const seekRange = this.point(Math.min(this._currentTime, to))
246
- .to(Math.max(this._currentTime, to));
245
+ const fromTime = Math.min(this._currentTime, to);
246
+ const toTime = Math.max(this._currentTime, to);
247
247
  this.ranges.slice().forEach((range) => {
248
- if (seekRange.overlaps(range)) {
248
+ const rangeEnd = range.position + range.duration;
249
+ const overlaps = fromTime <= rangeEnd && toTime >= range.position;
250
+ if (overlaps) {
249
251
  let progress = clamp((to - range.position) / range.duration, 0, 1);
250
252
  range.handlers.slice().forEach(h => h(progress));
251
253
  }
252
254
  });
253
- this.progressionHandlers.slice().forEach(h => h(this._currentTime / this._endPosition));
255
+ this.progressionHandlers.slice().forEach(h => h(fromTime / this._endPosition));
254
256
  }
255
257
  sortEntries(direction) {
256
258
  this.currentSortDirection = direction;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xtia/timeline",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "repository": {
5
5
  "url": "https://github.com/tiadrop/timeline",
6
6
  "type": "github"