@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 +1 -2
- package/internal/timeline.js +6 -4
- package/package.json +1 -1
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
|
|
101
|
-
Math.max(this.startPosition, this.endPosition) >= Math.min(start, end);
|
|
100
|
+
return this.startPosition <= end && this.endPosition >= start;
|
|
102
101
|
}
|
|
103
102
|
}
|
package/internal/timeline.js
CHANGED
|
@@ -242,15 +242,17 @@ export class Timeline {
|
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
244
|
seekRanges(to) {
|
|
245
|
-
const
|
|
246
|
-
|
|
245
|
+
const fromTime = Math.min(this._currentTime, to);
|
|
246
|
+
const toTime = Math.max(this._currentTime, to);
|
|
247
247
|
this.ranges.slice().forEach((range) => {
|
|
248
|
-
|
|
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(
|
|
255
|
+
this.progressionHandlers.slice().forEach(h => h(fromTime / this._endPosition));
|
|
254
256
|
}
|
|
255
257
|
sortEntries(direction) {
|
|
256
258
|
this.currentSortDirection = direction;
|