Mercurial > code > home > repos > light9
changeset 1465:e479109aba21
zoom adjusters now track parent element height changes
Ignore-this: b3680cbd5c917edf35cc2209e68260a4
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Sun, 12 Jun 2016 08:16:58 +0000 |
parents | ecce64268006 |
children | b72198260bf0 |
files | light9/web/timeline/timeline.coffee |
diffstat | 1 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/web/timeline/timeline.coffee Sun Jun 12 04:23:03 2016 +0000 +++ b/light9/web/timeline/timeline.coffee Sun Jun 12 08:16:58 2016 +0000 @@ -90,7 +90,8 @@ @dia.setTimeAxis(@width(), @$.zoomed.$.audio.offsetTop, @zoomInX) @$.adjusters.updateAllCoords() - # cursor needs update when layout changes, but I don't want zoom/layout to depend on the playback time + # cursor needs update when layout changes, but I don't want + # zoom/layout to depend on the playback time setTimeout(@songTimeChanged.bind(@), 1) songTimeChanged: -> @@ -175,11 +176,10 @@ @animatedZoom(newCenter - visSeconds / 2, newCenter + visSeconds / 2, zoomAnimSec) shortcut.add "L", => - @$.adjusters.layoutCenters() + @$.adjusters.updateAllCoords() makeZoomAdjs: -> - log('makeZoomAdjs', @adjs) - yMid = @$.audio.offsetTop + @$.audio.offsetHeight / 2 + yMid = => @$.audio.offsetTop + @$.audio.offsetHeight / 2 dur = @viewState.zoomSpec.duration valForPos = (pos) => @@ -188,7 +188,7 @@ @setAdjuster('zoom-left', => new AdjustableFloatObservable({ observable: @viewState.zoomSpec.t1, getTarget: () => - $V([@fullZoomX(@viewState.zoomSpec.t1()), yMid]) + $V([@fullZoomX(@viewState.zoomSpec.t1()), yMid()]) getSuggestedTargetOffset: () => $V([-50, 0]) getValueForPos: valForPos })) @@ -196,7 +196,7 @@ @setAdjuster('zoom-right', => new AdjustableFloatObservable({ observable: @viewState.zoomSpec.t2, getTarget: () => - $V([@fullZoomX(@viewState.zoomSpec.t2()), yMid]) + $V([@fullZoomX(@viewState.zoomSpec.t2()), yMid()]) getSuggestedTargetOffset: () => $V([50, 0]) getValueForPos: valForPos })) @@ -216,7 +216,7 @@ emptyBox: true # fullzoom is not right- the sides shouldn't be able to go # offscreen - getTarget: () => $V([@fullZoomX(panObs()), yMid]) + getTarget: () => $V([@fullZoomX(panObs()), yMid()]) getSuggestedTargetOffset: () => $V([0, 0]) getValueForPos: valForPos }))