# HG changeset patch # User Drew Perttula # Date 2018-05-28 00:25:46 # Node ID 887eb43b389a6838ecaddac4a406193b94aa8db0 # Parent 3368aeaded44e468230197d69d9eb4c94ebc9df1 properly clear adjs on narrow notes Ignore-this: 175b1c2b7ffdcccadfd49d8f81d9f3ad diff --git a/light9/web/timeline/timeline.coffee b/light9/web/timeline/timeline.coffee --- a/light9/web/timeline/timeline.coffee +++ b/light9/web/timeline/timeline.coffee @@ -446,7 +446,7 @@ class Note @parentElem.updateInlineAttrs(@uri, null) clearAdjusters: -> - for i in @adjusterIds.keys() + @adjusterIds.forEach (i) => @setAdjuster(i, null) @adjusterIds.clear() @@ -533,7 +533,8 @@ class Note @_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) diff --git a/light9/web/timeline/viewstate.coffee b/light9/web/timeline/viewstate.coffee --- a/light9/web/timeline/viewstate.coffee +++ b/light9/web/timeline/viewstate.coffee @@ -38,11 +38,12 @@ class window.ViewState 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))