blob: 0ff2dda51864c691960a37b3fb4837f94921d765 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2015 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/core/tracks/annotation_view.html">
<script>
'use strict';
tr.exportTo('tr.c.annotations', function() {
/**
* A view that draws a vertical line on the timeline at a specific timestamp.
* @extends {AnnotationView}
* @constructor
*/
function XMarkerAnnotationView(viewport, annotation) {
this.viewport_ = viewport;
this.annotation_ = annotation;
}
XMarkerAnnotationView.prototype = {
__proto__: tr.c.annotations.AnnotationView.prototype,
draw: function(ctx) {
var dt = this.viewport_.currentDisplayTransform;
var viewX = dt.xWorldToView(this.annotation_.timestamp);
ctx.beginPath();
tr.c.drawLine(ctx, viewX, 0, viewX, ctx.canvas.height);
ctx.strokeStyle = this.annotation_.strokeStyle;
ctx.stroke();
}
};
return {
XMarkerAnnotationView: XMarkerAnnotationView
};
});
</script>