changeset 1430:16599857ef66

more points to adjust Ignore-this: bf985c259e8b11348b663b6543908d8
author Drew Perttula <drewp@bigasterisk.com>
date Sat, 11 Jun 2016 17:40:22 +0000
parents 01dd3928b635
children f85cc11b3e8c
files light9/web/timeline/timeline.coffee
diffstat 1 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/timeline/timeline.coffee	Sat Jun 11 06:49:25 2016 +0000
+++ b/light9/web/timeline/timeline.coffee	Sat Jun 11 17:40:22 2016 +0000
@@ -341,21 +341,25 @@
             getValueForPos: (pos) => @zoomInX.invert(pos.e(1))
             getSuggestedTargetOffset: () => $V([0, -80])
           }))
-         
-          @setAdjuster(@uri+'/p3', adj = new AdjustableFloatObject({
-            graph: @graph
-            subj: worldPts[3].uri
-            pred: @graph.Uri(':time')
-            ctx: @graph.Uri(@song)
-            getTargetPosForValue: (value) => $V([@zoomInX(value), 600])
-            getValueForPos: (pos) => (@zoomInX.invert(pos.e(1)) - originTime)
-            getSuggestedTargetOffset: () => $V([0, -80])
-          }))
-          adj._getValue = (=>
-            # note: don't use originTime from the closure- we need the
-            # graph dependency
-            adj._currentValue + @graph.floatValue(@uri, U(':originTime'))
-            )
+
+          for pointNum in [0, 2, 3]
+            @setAdjuster(@uri+'/p'+pointNum, adj = new AdjustableFloatObject({
+              graph: @graph
+              subj: worldPts[pointNum].uri
+              pred: @graph.Uri(':time')
+              ctx: @graph.Uri(@song)
+              getTargetPosForValue: (value) => $V([@zoomInX(value), 600])
+              getValueForPos: (pos) =>
+                origin = @graph.floatValue(@uri, U(':originTime'))
+                (@zoomInX.invert(pos.e(1)) - origin)
+              getSuggestedTargetOffset: () => $V([0, -80])
+            }))
+            adj._getValue = (=>
+              # note: don't use originTime from the closure- we need the
+              # graph dependency
+              adj._currentValue + @graph.floatValue(@uri, U(':originTime'))
+              )
+            console.log(adj)
           
       screenPos = (pt) =>
         $V([@zoomInX(pt.e(1)), @offsetTop + (1 - pt.e(2)) * @offsetHeight])