changeset 1734:15cdf021c07f

oops, time cursor was tracking mouse not music time Ignore-this: 4a659c258fb87156a44a53e11b50baed
author Drew Perttula <drewp@bigasterisk.com>
date Tue, 15 May 2018 06:33:39 +0000
parents 82c6e4f75221
children fa11008d9b22
files light9/web/timeline/cursor_canvas.coffee light9/web/timeline/timeline.coffee
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/light9/web/timeline/cursor_canvas.coffee	Mon May 14 02:48:20 2018 +0000
+++ b/light9/web/timeline/cursor_canvas.coffee	Tue May 15 06:33:39 2018 +0000
@@ -4,8 +4,6 @@
     viewState: { type: Object, notify: true, observer: "onViewState" }
   ready: ->
     super.ready()
-    @mouseX = 0
-    @mouseY = 0
     @cursorPath = null
     @ctx = @$.canvas.getContext('2d')
     @onResize()
@@ -22,8 +20,8 @@
   redrawCursor: ->
     vs = @viewState
     dependOn = [vs.zoomSpec.t1(), vs.zoomSpec.t2()]
-    xZoomedOut = vs.fullZoomX(vs.latestMouseTime())
-    xZoomedIn = vs.mouse.pos().e(1)
+    xZoomedOut = vs.fullZoomX(vs.cursor.t())
+    xZoomedIn = vs.zoomInX(vs.cursor.t())
 
     @cursorPath = {
       top0: $V([xZoomedOut, vs.audioY()])
@@ -44,8 +42,9 @@
     @ctx.strokeStyle = '#fff'
     @ctx.lineWidth = 0.5
     @ctx.beginPath()
-    Drawing.line(@ctx, $V([0, @mouseY]), $V([@$.canvas.width, @mouseY]))
-    Drawing.line(@ctx, $V([@mouseX, 0]), $V([@mouseX, @$.canvas.height]))
+    mouse = @viewState.mouse.pos()
+    Drawing.line(@ctx, $V([0, mouse.e(2)]), $V([@$.canvas.width, mouse.e(2)]))
+    Drawing.line(@ctx, $V([mouse.e(1), 0]), $V([mouse.e(1), @$.canvas.height]))
     @ctx.stroke()
 
     if @cursorPath
--- a/light9/web/timeline/timeline.coffee	Mon May 14 02:48:20 2018 +0000
+++ b/light9/web/timeline/timeline.coffee	Tue May 15 06:33:39 2018 +0000
@@ -233,7 +233,7 @@
 
   bindKeys: ->
     shortcut.add "Ctrl+P", (ev) =>
-      @$.music.seekPlayOrPause(@latestMouseTime())
+      @$.music.seekPlayOrPause(@viewState.latestMouseTime())
     shortcut.add "Ctrl+Escape", => @viewState.frameAll()
     shortcut.add "Shift+Escape", => @viewState.frameToEnd()
     shortcut.add "Escape", => @viewState.frameCursor()