# HG changeset patch # User Drew Perttula # Date 2018-05-07 00:38:33 # Node ID 9723a5ab27d630656cb0127b3563203d56aa5b4f # Parent 165df402cb983533ce2af48a95cdd7fef5f725b1 fight coffeescript on how to get ctor called Ignore-this: b74e7e5547fb234716862e5dfa4e2885 diff --git a/light9/web/timeline/adjustable.coffee b/light9/web/timeline/adjustable.coffee --- a/light9/web/timeline/adjustable.coffee +++ b/light9/web/timeline/adjustable.coffee @@ -11,6 +11,9 @@ class Adjustable # into stuff or to get out from under your finger. constructor: (@config) -> + @ctor2() + + ctor2: () -> # config has: # getTarget -> vec2 of current target position # getSuggestedTargetOffset -> vec2 pixel offset from target @@ -75,7 +78,8 @@ class window.AdjustableFloatObservable e # observable -> ko.observable we will read and write # getValueForPos(pos) -> what should we set to if the user # moves target to this coord? - super(@config) + super() + @ctor2() _getValue: () -> @config.observable() @@ -102,8 +106,8 @@ class window.AdjustableFloatObject exten # ctx # getTargetPosForValue(value) -> getTarget result for value # getValueForPos - - super(@config) + super() + @ctor2() if not @config.ctx? throw new Error("missing ctx") @config.graph.runHandler(@_syncValue.bind(@), "adj sync #{@config.subj}") @@ -136,12 +140,13 @@ class window.AdjustableFloatObject exten class window.AdjustableFade extends Adjustable constructor: (@yForV, @i0, @i1, @note, offset, ctx) -> + super() @config = { getSuggestedTargetOffset: -> offset getTarget: @getTarget.bind(@) ctx: ctx } - super(@config) + @ctor2() getTarget: -> mid = @note.worldPts[@i0].x(.5).add(@note.worldPts[@i1].x(.5))