diff --git a/light9/web/timeline/index.html b/light9/web/timeline/index.html --- a/light9/web/timeline/index.html +++ b/light9/web/timeline/index.html @@ -7,7 +7,7 @@ - + diff --git a/light9/web/timeline/timeline-elements.html b/light9/web/timeline/timeline-elements.html --- a/light9/web/timeline/timeline-elements.html +++ b/light9/web/timeline/timeline-elements.html @@ -32,6 +32,11 @@ position: absolute; left: 0; top: 0; right: 0; bottom: 0; } + #debug { + background: white; + font-family: monospace; + font-size: 125%; + }
@@ -43,7 +48,7 @@ timeline editor: song
-
[[debug]]
+
[[debug]]
+ @debug_zoomOrLayoutChangedCount = 0 @viewState = zoomSpec: duration: ko.observable(100) @@ -46,6 +47,11 @@ Polymer @fullZoomX = d3.scaleLinear() @zoomInX = d3.scaleLinear() @setAdjuster = @$.adjusters.setAdjuster.bind(@$.adjusters) + + setInterval(@updateDebugSummary.bind(@), 100) + + updateDebugSummary: -> + @debug = "#{@debug_zoomOrLayoutChangedCount} layout change, " attached: -> @dia = @$.dia @@ -59,6 +65,9 @@ Polymer @makeZoomAdjs() zoomOrLayoutChanged: -> + # not for cursor updates + + @debug_zoomOrLayoutChangedCount++ @fullZoomX.domain([0, @viewState.zoomSpec.duration()]) @fullZoomX.range([0, @width()]) @@ -72,7 +81,8 @@ Polymer @dia.setTimeAxis(@width(), @$.zoomed.$.audio.offsetTop, @zoomInX) @$.adjusters.updateAllCoords() - @songTimeChanged() + # cursor needs update when layout changes, but I don't want zoom/layout to depend on the playback time + setTimeout(@songTimeChanged.bind(@), 1) songTimeChanged: -> @dia.setCursor(@$.audio.offsetTop, @$.audio.offsetHeight,