Changeset - 887eb43b389a
[Not reviewed]
default
0 2 0
Drew Perttula - 7 years ago 2018-05-28 00:25:46
drewp@bigasterisk.com
properly clear adjs on narrow notes
Ignore-this: 175b1c2b7ffdcccadfd49d8f81d9f3ad
2 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
light9/web/timeline/timeline.coffee
Show inline comments
 
@@ -443,13 +443,13 @@ class Note
 
    log('destroy', @uri.value)
 
    @isDetached = true
 
    @clearAdjusters()
 
    @parentElem.updateInlineAttrs(@uri, null)
 

	
 
  clearAdjusters: ->
 
    for i in @adjusterIds.keys()
 
    @adjusterIds.forEach (i) =>
 
      @setAdjuster(i, null)
 
    @adjusterIds.clear()
 

	
 
  getCurvePoints: (subj, curveAttr) ->
 
    U = (x) => @graph.Uri(x)
 
    originTime = @graph.floatValue(subj, U(':originTime'))
 
@@ -530,13 +530,14 @@ class Note
 
    if @isDetached?
 
      return
 

	
 
    @_updateDisplay()
 

	
 
  _updateAdjusters: (screenPts, worldPts, curveWidthCalc, yForV, ctx) ->
 
    if screenPts[screenPts.length - 1].x - screenPts[0].x < 100
 
    # todo: allow offset even on more narrow notes
 
    if screenPts[screenPts.length - 1].x - screenPts[0].x < 100 or screenPts[0].x > @parentElem.offsetWidth or screenPts[screenPts.length - 1].x < 0
 
      @clearAdjusters()
 
    else
 
      @_makeOffsetAdjuster(yForV, curveWidthCalc, ctx)
 
      @_makeCurvePointAdjusters(yForV, worldPts, ctx)
 
      @_makeFadeAdjusters(yForV, ctx, worldPts)
 

	
light9/web/timeline/viewstate.coffee
Show inline comments
 
@@ -35,17 +35,18 @@ class window.ViewState
 

	
 
    if @zoomSpec.t1() < 0
 
      @zoomSpec.t1(0)
 
    if @zoomSpec.duration() and @zoomSpec.t2() > @zoomSpec.duration()
 
      @zoomSpec.t2(@zoomSpec.duration())
 

	
 
    rightPad = 2 # don't let time adjuster fall off right edge
 
    @fullZoomX.domain([0, @zoomSpec.duration()])
 
    @fullZoomX.range([0, @width()])
 
    @fullZoomX.range([0, @width() - rightPad])
 

	
 
    @zoomInX.domain([@zoomSpec.t1(), @zoomSpec.t2()])
 
    @zoomInX.range([0, @width()])
 
    @zoomInX.range([0, @width() - rightPad])
 
    
 
  latestMouseTime: ->
 
    @zoomInX.invert(@mouse.pos().e(1))
 

	
 
  onMouseWheel: (deltaY) ->
 
    zs = @zoomSpec
0 comments (0 inline, 0 general)