@@ -84,9 +84,11 @@ function debugModule(module, runtime) {
84 programPaused = v;
84 programPaused = v;
85 if (programPaused) {
85 if (programPaused) {
86 clearAsyncCallbacks();
86 clearAsyncCallbacks();
87+ tracePath.stopRecording();
89 executeCallbacks(asyncCallbacks);
90 executeCallbacks(asyncCallbacks);
91+ tracePath.startRecording();
@@ -106,6 +108,7 @@ function debugModule(module, runtime) {
107 var moduleInstance = module.make(wrappedRuntime);
109 var moduleInstance = module.make(wrappedRuntime);
108 var moduleNodes = flattenNodes(wrappedRuntime.inputs);
110 var moduleNodes = flattenNodes(wrappedRuntime.inputs);
111+ var tracePath = tracePathInit(runtime);
111 moduleInstance: moduleInstance,
114 moduleInstance: moduleInstance,
@@ -119,7 +122,7 @@ function debugModule(module, runtime) {
119 getRecordedEventAt: getRecordedEventAt,
122 getRecordedEventAt: getRecordedEventAt,
120 getPaused: getPaused,
123 getPaused: getPaused,
121 setPaused: setPaused,
124 setPaused: setPaused,
122− tracePath: tracePathInit(runtime)
125+ tracePath: tracePath
@@ -228,6 +231,7 @@ function tracePathInit(runtime) {
228 var List = Elm.List.make(runtime);
231 var List = Elm.List.make(runtime);
229 var tracePathCanvas = createCanvas();
232 var tracePathCanvas = createCanvas();
230 var tracePositions = {};
233 var tracePositions = {};
234+ var recordingTraces = true;
232 function findPositions(currentScene) {
236 function findPositions(currentScene) {
233 var positions = {};
237 var positions = {};
@@ -269,6 +273,10 @@ function tracePathInit(runtime) {
271 function graphicsUpdate(currentScene) {
275 function graphicsUpdate(currentScene) {
276+ if (!recordingTraces) {
272 var ctx = tracePathCanvas.getContext('2d');
280 var ctx = tracePathCanvas.getContext('2d');
273 ctx.clearRect(0, 0, tracePathCanvas.width, tracePathCanvas.height);
281 ctx.clearRect(0, 0, tracePathCanvas.width, tracePathCanvas.height);
@@ -301,10 +309,20 @@ function tracePathInit(runtime) {
301 tracePositions = {};
309 tracePositions = {};
312+ function stopRecording() {
313+ recordingTraces = false;
316+ function startRecording() {
317+ recordingTraces = true;
305 graphicsUpdate: graphicsUpdate,
321 graphicsUpdate: graphicsUpdate,
306 canvas: tracePathCanvas,
322 canvas: tracePathCanvas,
307− clearTraces: clearTraces
323+ clearTraces: clearTraces,
324+ stopRecording: stopRecording,
325+ startRecording: startRecording