@@ -84,9 +84,11 @@ function debugModule(module, runtime) {
8484 programPaused = v;
8585 if (programPaused) {
8686 clearAsyncCallbacks();
87+ tracePath.stopRecording();
8788 }
8889 else {
8990 executeCallbacks(asyncCallbacks);
91+ tracePath.startRecording();
9092 }
9193 }
9294
@@ -106,6 +108,7 @@ function debugModule(module, runtime) {
106108
107109 var moduleInstance = module.make(wrappedRuntime);
108110 var moduleNodes = flattenNodes(wrappedRuntime.inputs);
111+ var tracePath = tracePathInit(runtime);
109112
110113 return {
111114 moduleInstance: moduleInstance,
@@ -119,7 +122,7 @@ function debugModule(module, runtime) {
119122 getRecordedEventAt: getRecordedEventAt,
120123 getPaused: getPaused,
121124 setPaused: setPaused,
122− tracePath: tracePathInit(runtime)
125+ tracePath: tracePath
123126 };
124127}
125128
@@ -228,6 +231,7 @@ function tracePathInit(runtime) {
228231 var List = Elm.List.make(runtime);
229232 var tracePathCanvas = createCanvas();
230233 var tracePositions = {};
234+ var recordingTraces = true;
231235
232236 function findPositions(currentScene) {
233237 var positions = {};
@@ -269,6 +273,10 @@ function tracePathInit(runtime) {
269273 }
270274
271275 function graphicsUpdate(currentScene) {
276+ if (!recordingTraces) {
277+ return;
278+ }
279+
272280 var ctx = tracePathCanvas.getContext('2d');
273281 ctx.clearRect(0, 0, tracePathCanvas.width, tracePathCanvas.height);
274282
@@ -301,10 +309,20 @@ function tracePathInit(runtime) {
301309 tracePositions = {};
302310 }
303311
312+ function stopRecording() {
313+ recordingTraces = false;
314+ }
315+
316+ function startRecording() {
317+ recordingTraces = true;
318+ }
319+
304320 return {
305321 graphicsUpdate: graphicsUpdate,
306322 canvas: tracePathCanvas,
307− clearTraces: clearTraces
323+ clearTraces: clearTraces,
324+ stopRecording: stopRecording,
325+ startRecording: startRecording
308326 }
309327}
310328