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 @@ -93,6 +93,11 @@ class window.AdjustableFloatObject exten # getValueForPos super(@config) + @config.graph.runHandler(@_syncValue.bind(@)) + + _syncValue: () -> + @_currentValue = @config.graph.floatValue(@config.subj, @config.pred) + @_onChange() if @_onChange _getValue: () -> # this is a big speedup- callers use _getValue about 4x as much as @@ -103,9 +108,10 @@ class window.AdjustableFloatObject exten @config.getTargetTransform(@_getValue()) subscribe: (onChange) -> - @config.graph.subscribe @config.subj, @config.pred, null, (patch) => - @_currentValue = @config.graph.floatValue(@config.subj, @config.pred) - onChange() + # only works on one subscription at a time + throw new Error('multi subscribe not implemented') if @_onChange + @_onChange = onChange + continueDrag: (pos) -> # pos is vec2 of pixels relative to the drag start