on master help sign in
change type of trace to String -> Form -> Form
4cca2f1Michael James
libraries/Debug.elm+3−3
@@ -9,7 +9,7 @@ module Debug where
9@docs watch, watchSummary, trace
9@docs watch, watchSummary, trace
10-}
10-}
11
11
12−import Graphics.Element (Element)
12+import Graphics.Collage (Form)
13import Native.Debug
13import Native.Debug
14import Native.Error
14import Native.Error
15
15
@@ -60,7 +60,7 @@ watch = Native.Debug.watch
60watchSummary : String -> (a -> b) -> a -> a
60watchSummary : String -> (a -> b) -> a -> a
61watchSummary = Native.Debug.watchSummary
61watchSummary = Native.Debug.watchSummary
62
62
63−{-| Trace an Element over time in the reactive debugger.
63+{-| Trace a Form over time in the reactive debugger.
64-}
64-}
65−trace : String -> Element -> Element
65+trace : String -> Form -> Form
66trace = Native.Debug.tracePath
66trace = Native.Debug.tracePath
libraries/Native/Debug.js+2−3
@@ -20,9 +20,8 @@ Elm.Native.Debug.make = function(elm) {
20 return value;
20 return value;
21 }
21 }
22
22
23− function tracePath(debugId, elem) {
23+ function tracePath(debugId, form) {
24− var props = replace([["debugTracePathId",debugId]], elem.props);
24+ return replace([["debugTracePathId",debugId]], form);
25− return replace([["props",props]], elem);
26 }
25 }
27
26
28 function WatchTracker() {
27 function WatchTracker() {
runtime/Debugger.js+8−4
@@ -385,10 +385,6 @@ function tracePathInit(runtime, signalGraphMain) {
385 {
385 {
386 List.map(F2(processForm)(offset))(elem.element.model.forms);
386 List.map(F2(processForm)(offset))(elem.element.model.forms);
387 }
387 }
388− if (elem.props.debugTracePathId)
389− {
390− positions[elem.props.debugTracePathId] = new Point(offset.x, offset.y);
391− }
392 }
388 }
393
389
394 function processForm(offset, form) {
390 function processForm(offset, form) {
@@ -396,6 +392,14 @@ function tracePathInit(runtime, signalGraphMain) {
396 {
392 {
397 processElement(form.form._0, offset.translate(form.x, -form.y));
393 processElement(form.form._0, offset.translate(form.x, -form.y));
398 }
394 }
395+ if (form.form.ctor == "FGroup")
396+ {
397+ List.map(F2(processForm)(offset))(form.form._1);
398+ }
399+ if (form.debugTracePathId)
400+ {
401+ positions[form.debugTracePathId] = new Point(form.x + offset.x, -form.y + offset.y);
402+ }
399 }
403 }
400
404
401 processElement(currentScene, new Point(0, 0));
405 processElement(currentScene, new Point(0, 0));