From df1b3d50b7dd7b854faf6e87b4ce1dffb3cce5ec Mon Sep 17 00:00:00 2001 From: Yanzhen Yu Date: Fri, 14 Dec 2018 14:11:49 +0800 Subject: [PATCH] fix resume to move baseline time by time offset --- src/replay/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/replay/index.ts b/src/replay/index.ts index 44cd15fd..73774d03 100644 --- a/src/replay/index.ts +++ b/src/replay/index.ts @@ -111,6 +111,7 @@ export class Replayer { public resume(timeOffset = 0) { this.timer.clear(); + this.baselineTime = this.events[0].timestamp + timeOffset; const actions = new Array(); for (const event of this.events) { if ( @@ -119,11 +120,10 @@ export class Replayer { ) { continue; } - const delayToBaseline = this.getDelay(event); const castFn = this.getCastFn(event); actions.push({ doAction: castFn, - delay: delayToBaseline - timeOffset, + delay: this.getDelay(event), }); } this.timer.addActions(actions);