# HG changeset patch # User Drew Perttula # Date 1465449392 0 # Node ID 748a2e8afd305ca19a616e394c4d2c3b864cd31a # Parent 6fd81bd4b4a70a9b295f19d43782ee57581ccb4e rdf graph adjuster, use new runHandler api Ignore-this: 51fe3a2f2799f473658cc83ed8485ecc diff -r 6fd81bd4b4a7 -r 748a2e8afd30 light9/web/timeline/adjustable.coffee --- a/light9/web/timeline/adjustable.coffee Thu Jun 09 05:16:29 2016 +0000 +++ b/light9/web/timeline/adjustable.coffee Thu Jun 09 05:16:32 2016 +0000 @@ -93,6 +93,11 @@ # 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 @@ @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