@@ -171,8 +171,8 @@ function debugModule(module, runtime) {
173 function setContinue(position) {
173 function setContinue(position) {
174− var timerDelay = Date.now() - pauseTime;
174+ var pauseDelay = Date.now() - pauseTime;
175− runtime.timer.addDelay(timerDelay);
175+ runtime.timer.addDelay(pauseDelay);
176 programPaused = false;
176 programPaused = false;
177 if (position > 0) {
177 if (position > 0) {
178 // If we're not unpausing at the head, then we need to dump the
178 // If we're not unpausing at the head, then we need to dump the
@@ -180,6 +180,11 @@ function debugModule(module, runtime) {
180 var lastSnapshotPosition = Math.floor(position / EVENTS_PER_SAVE);
180 var lastSnapshotPosition = Math.floor(position / EVENTS_PER_SAVE);
181 eventsUntilSnapshot = EVENTS_PER_SAVE - (position % EVENTS_PER_SAVE);
181 eventsUntilSnapshot = EVENTS_PER_SAVE - (position % EVENTS_PER_SAVE);
182 snapshots = snapshots.slice(0, lastSnapshotPosition + 1);
182 snapshots = snapshots.slice(0, lastSnapshotPosition + 1);
184+ var lastEventTime = recordedEvents[position-1].timestep;
185+ var scrubTime = runtime.timer.now() - lastEventTime;
186+ runtime.timer.addDelay(scrubTime);
183 recordedEvents = recordedEvents.slice(0, position);
188 recordedEvents = recordedEvents.slice(0, position);
184 tracePath.clearTracesAfter(position);
189 tracePath.clearTracesAfter(position);
185 eventCounter = position;
190 eventCounter = position;