# HG changeset patch # User drewp@bigasterisk.com # Date 1465698989 0 # Node ID d8929e28b8bcb95d0c7dd5bec5e791fbe4760b92 # Parent a7de122a7b18c1cdd1cf3d220173f9bfc43bade3 TL: bring back debug line. optimize refreshes when only time cursor changed Ignore-this: f0a90866c1e909c4f8365873f63c8c24 diff -r a7de122a7b18 -r d8929e28b8bc light9/web/timeline/index.html --- a/light9/web/timeline/index.html Sun Jun 12 02:12:28 2016 +0000 +++ b/light9/web/timeline/index.html Sun Jun 12 02:36:29 2016 +0000 @@ -7,7 +7,7 @@ - + diff -r a7de122a7b18 -r d8929e28b8bc light9/web/timeline/timeline-elements.html --- a/light9/web/timeline/timeline-elements.html Sun Jun 12 02:12:28 2016 +0000 +++ b/light9/web/timeline/timeline-elements.html Sun Jun 12 02:36:29 2016 +0000 @@ -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 @@ @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 @@ @makeZoomAdjs() zoomOrLayoutChanged: -> + # not for cursor updates + + @debug_zoomOrLayoutChangedCount++ @fullZoomX.domain([0, @viewState.zoomSpec.duration()]) @fullZoomX.range([0, @width()]) @@ -72,7 +81,8 @@ @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,