fix resume to move baseline time by time offset
This commit is contained in:
@@ -111,6 +111,7 @@ export class Replayer {
|
|||||||
|
|
||||||
public resume(timeOffset = 0) {
|
public resume(timeOffset = 0) {
|
||||||
this.timer.clear();
|
this.timer.clear();
|
||||||
|
this.baselineTime = this.events[0].timestamp + timeOffset;
|
||||||
const actions = new Array<actionWithDelay>();
|
const actions = new Array<actionWithDelay>();
|
||||||
for (const event of this.events) {
|
for (const event of this.events) {
|
||||||
if (
|
if (
|
||||||
@@ -119,11 +120,10 @@ export class Replayer {
|
|||||||
) {
|
) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const delayToBaseline = this.getDelay(event);
|
|
||||||
const castFn = this.getCastFn(event);
|
const castFn = this.getCastFn(event);
|
||||||
actions.push({
|
actions.push({
|
||||||
doAction: castFn,
|
doAction: castFn,
|
||||||
delay: delayToBaseline - timeOffset,
|
delay: this.getDelay(event),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.timer.addActions(actions);
|
this.timer.addActions(actions);
|
||||||
|
|||||||
Reference in New Issue
Block a user