on master help sign in
Debugger: move tracePath signal node to trace path module.
commit52ae89c24d2d97d8b0f85a12efecc2d4a1f494e3 authorLaszlo Pandy <laszlo.pandy@prezi.com> dateWed 6 Nov 2013, 18:32 (13 years ago) parente327ac0
1 file changed+6−7
runtime/Debugger.js+6−7
runtime/Debugger.js+6−7
@@ -120,7 +120,7 @@ function debugModule(module, runtime) {
120120
121121 var moduleInstance = module.make(wrappedRuntime);
122122 var moduleNodes = flattenNodes(wrappedRuntime.inputs);
123− var tracePath = tracePathInit(runtime);
123+ var tracePath = tracePathInit(runtime, moduleInstance.main);
124124
125125 return {
126126 moduleInstance: moduleInstance,
@@ -141,11 +141,6 @@ function debugModule(module, runtime) {
141141}
142142
143143function debuggerInit(debugModule, runtime, hotSwapState /* =undefined */) {
144− var Signal = Elm.Signal.make(runtime);
145−
146− var tracePathNode = A2(Signal.lift, debugModule.tracePath.graphicsUpdate, debugModule.moduleInstance.main);
147− runtime.node.parentNode.appendChild(debugModule.tracePath.canvas);
148−
149144 var eventCounter = 0;
150145
151146 function resetProgram() {
@@ -248,6 +243,8 @@ function debuggerInit(debugModule, runtime, hotSwapState /* =undefined */) {
248243 stepTo(hotSwapState.eventCounter);
249244 }
250245
246+ runtime.node.parentNode.appendChild(debugModule.tracePath.canvas);
247+
251248 var elmDebugger = {
252249 restart: restartProgram,
253250 pause: pauseProgram,
@@ -277,8 +274,10 @@ function Point(x, y) {
277274 }
278275}
279276
280−function tracePathInit(runtime) {
277+function tracePathInit(runtime, mainNode) {
281278 var List = Elm.List.make(runtime);
279+ var Signal = Elm.Signal.make(runtime);
280+ var tracePathNode = A2(Signal.lift, graphicsUpdate, mainNode);
282281 var tracePathCanvas = createCanvas();
283282 var tracePositions = {};
284283 var recordingTraces = true;