on master help sign in
change type of trace to String -> Form -> Form
commit4cca2f1ed994008f78178e558518a845f55ca58f authorMichael James <michael@michaelbjames.com> dateTue 29 Jul 2014, 11:18 (12 years ago) parent9e7ff43
3 files changed+13−10
libraries/Debug.elm+3−3 libraries/Native/Debug.js+2−3 runtime/Debugger.js+8−4
libraries/Debug.elm+3−3
@@ -9,7 +9,7 @@ module Debug where
99@docs watch, watchSummary, trace
1010-}
1111
12−import Graphics.Element (Element)
12+import Graphics.Collage (Form)
1313import Native.Debug
1414import Native.Error
1515
@@ -60,7 +60,7 @@ watch = Native.Debug.watch
6060watchSummary : String -> (a -> b) -> a -> a
6161watchSummary = Native.Debug.watchSummary
6262
63−{-| Trace an Element over time in the reactive debugger.
63+{-| Trace a Form over time in the reactive debugger.
6464-}
65−trace : String -> Element -> Element
65+trace : String -> Form -> Form
6666trace = Native.Debug.tracePath
libraries/Native/Debug.js+2−3
@@ -20,9 +20,8 @@ Elm.Native.Debug.make = function(elm) {
2020 return value;
2121 }
2222
23− function tracePath(debugId, elem) {
24− var props = replace([["debugTracePathId",debugId]], elem.props);
25− return replace([["props",props]], elem);
23+ function tracePath(debugId, form) {
24+ return replace([["debugTracePathId",debugId]], form);
2625 }
2726
2827 function WatchTracker() {
runtime/Debugger.js+8−4
@@ -385,10 +385,6 @@ function tracePathInit(runtime, signalGraphMain) {
385385 {
386386 List.map(F2(processForm)(offset))(elem.element.model.forms);
387387 }
388− if (elem.props.debugTracePathId)
389− {
390− positions[elem.props.debugTracePathId] = new Point(offset.x, offset.y);
391− }
392388 }
393389
394390 function processForm(offset, form) {
@@ -396,6 +392,14 @@ function tracePathInit(runtime, signalGraphMain) {
396392 {
397393 processElement(form.form._0, offset.translate(form.x, -form.y));
398394 }
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+ }
399403 }
400404
401405 processElement(currentScene, new Point(0, 0));