changeset 1815:46d1c0f0a5ce

attempted redraw fixes, but the real problem is in autodeps Ignore-this: 96cc361f1951d165131d46b8173b6685
author drewp@bigasterisk.com
date Fri, 08 Jun 2018 11:50:13 +0000
parents fba2a716ef2a
children 13d5902298a4
files light9/web/timeline/adjustable.coffee light9/web/timeline/adjusters.coffee light9/web/timeline/timeline.coffee
diffstat 3 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/timeline/adjustable.coffee	Fri Jun 08 11:49:08 2018 +0000
+++ b/light9/web/timeline/adjustable.coffee	Fri Jun 08 11:50:13 2018 +0000
@@ -110,8 +110,9 @@
     @ctor2()
     if not @config.ctx?
       throw new Error("missing ctx")
+    # this seems to not fire enough.
     @config.graph.runHandler(@_syncValue.bind(@),
-                             "adj sync #{@config.subj.value}")
+                             "adj sync #{@config.subj.value} #{@config.pred.value}")
 
   _syncValue: () ->
     @_currentValue = @config.graph.floatValue(@config.subj, @config.pred)
@@ -138,6 +139,7 @@
     @config.graph.patchObject(@config.subj, @config.pred,
                               @config.graph.LiteralRoundedFloat(newValue),
                               @config.ctx)
+    #@_syncValue()
 
 class window.AdjustableFade extends Adjustable
   constructor: (@yForV, @zoomInX, @i0, @i1, @note, offset, ctx) ->
--- a/light9/web/timeline/adjusters.coffee	Fri Jun 08 11:49:08 2018 +0000
+++ b/light9/web/timeline/adjusters.coffee	Fri Jun 08 11:50:13 2018 +0000
@@ -48,6 +48,7 @@
       @currentDrag.cur = pos
       @currentDrag.adj.continueDrag(
         @currentDrag.cur.subtract(@currentDrag.start))
+      @redraw()
     else
       near = @_adjAtPoint(pos)
       if @hoveringNear != near
@@ -64,13 +65,14 @@
     # adjuster elements for. Caller invents adjId.  makeAdjustable is
     # a function returning the Adjustable or it is null to clear any
     # adjusters with this id.
-    if not @adjs[adjId] or not makeAdjustable?
-      if not makeAdjustable?
+    if not makeAdjustable?
+      if @adjs[adjId]
         delete @adjs[adjId]
-      else
-        adj = makeAdjustable()
-        @adjs[adjId] = adj
-        adj.id = adjId
+    else
+      # this might be able to reuse an existing one a bit
+      adj = makeAdjustable()
+      @adjs[adjId] = adj
+      adj.id = adjId
 
     @redraw()
 
--- a/light9/web/timeline/timeline.coffee	Fri Jun 08 11:49:08 2018 +0000
+++ b/light9/web/timeline/timeline.coffee	Fri Jun 08 11:50:13 2018 +0000
@@ -537,6 +537,7 @@
     @_traceBorder(params.screenPts, 2, 0xffd900)
 
     @_addMouseBindings()
+    
                  
   update: ->
     if not @parentElem.isActiveNote(@uri)