# HG changeset patch # User Drew Perttula # Date 1465666822 0 # Node ID 16599857ef66076b54e57120560ca35e29b2836a # Parent 01dd3928b635248271ebe74a37edfb476d3eda1d more points to adjust Ignore-this: bf985c259e8b11348b663b6543908d8 diff -r 01dd3928b635 -r 16599857ef66 light9/web/timeline/timeline.coffee --- 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])