Changeset - aec09f94c030
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 7 years ago 2018-05-31 20:48:43
drewp@bigasterisk.com
fix notes drawing themselves after they should be gone
Ignore-this: 8ce4b8b194dbc13836d22535de92294d
1 file changed with 12 insertions and 0 deletions:
0 comments (0 inline, 0 general)
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -360,8 +360,13 @@ coffeeElementSetup(class TimeZoomed exte
 

	
 
    @renderer.render(@stage)
 

	
 
  isActiveNote: (note) ->
 
    return @noteByUriStr.has(note.value)
 

	
 
  _addNote: (uri, noteNum) ->
 
    U = (x) => @graph.Uri(x)
 

	
 
    
 
    con = new PIXI.Container()
 
    con.interactive=true
 
    @stage.addChild(con)
 
@@ -369,7 +374,9 @@ coffeeElementSetup(class TimeZoomed exte
 
    row = noteNum % 6
 
    rowTop = @viewState.rowsY() + 20 + 150 * row
 
    note = new Note(@, con, @project, @graph, @selection, uri, @setAdjuster, U(@song), @viewState, rowTop, rowTop + 140)
 
    # this must come before the first Note.draw
 
    @noteByUriStr.set(uri.value, note)
 
    note.initWatchers()
 

	
 
  _delNote: (uriStr) ->
 
    n = @noteByUriStr.get(uriStr)
 
@@ -436,6 +443,8 @@ coffeeElementSetup(class TimeAxis extend
 
class Note
 
  constructor: (@parentElem, @container, @project, @graph, @selection, @uri, @setAdjuster, @song, @viewState, @rowTopY, @rowBotY) ->
 
    @adjusterIds = new Set() # id string
 

	
 
  initWatchers: ->
 
    @graph.runHandler(@draw.bind(@), "note draw #{@uri.value}")
 
    ko.computed @draw.bind(@)
 

	
 
@@ -460,6 +469,9 @@ class Note
 
    throw new Error("curve #{@uri.value} has no attr #{curveAttr.value}")
 

	
 
  draw: ->
 
    if not @parentElem.isActiveNote(@uri)
 
      # stale redraw call
 
      return
 
    U = (x) => @graph.Uri(x)
 
    [pointUris, worldPts] = @getCurvePoints(@uri, U(':strength'))
 
    effect = @graph.uriValue(@uri, U(':effectClass'))
0 comments (0 inline, 0 general)