diff --git a/light9/web/timeline-elements.html b/light9/web/timeline-elements.html --- a/light9/web/timeline-elements.html +++ b/light9/web/timeline-elements.html @@ -80,7 +80,7 @@
- + @@ -142,6 +142,7 @@ y="631.3988" id="text4290" sodipodi:linespacing="125%" >spotchase + @@ -159,15 +160,14 @@ - diff --git a/light9/web/timeline.coffee b/light9/web/timeline.coffee --- a/light9/web/timeline.coffee +++ b/light9/web/timeline.coffee @@ -29,6 +29,7 @@ Polymer ko.computed => @fullZoomX = d3.scaleLinear().domain([0, @viewState.zoomSpec.duration()]).range([0, @width()]) @zoomInX = d3.scaleLinear().domain([@viewState.zoomSpec.t1(), @viewState.zoomSpec.t2()]).range([0, @width()]) + @dia.setTimeAxis(@width(), @$.zoomed.$.audio.offsetTop, @zoomInX) @$.adjusters.updateAllCoords() animCursor = () => @@ -116,6 +117,12 @@ Polymer return [left, right, pan] Polymer + is: "light9-timeline-time-axis", + # for now since it's just one line calling dia, + # light9-timeline-editor does our drawing work. + + +Polymer is: "light9-timeline-adjusters" properties: adjs: { type: Array }, @@ -191,6 +198,11 @@ Polymer window.setNote = @setNote.bind(this) window.setMouse = @setMouse.bind(this) + setTimeAxis: (width, yTop, scale) -> + pxPerTick = 50 + axis = d3.axisTop(scale).ticks(width / pxPerTick) + d3.select(@$.timeAxis).attr('transform', 'translate(0,'+yTop+')').call(axis) + setMouse: (pos) -> elem = @getOrCreateElem('mouse-x', 'mouse', 'path', {style: "fill:none;stroke:#333;stroke-width:0.5;"}) elem.setAttribute('d', svgPathFromPoints([[-999, pos.e(2)], [999, pos.e(2)]]))