mirror of https://github.com/nealey/vail.git
Always draw all the way to the right.
This probably makes more sense to people.
This commit is contained in:
parent
125579ec70
commit
54668eb0f1
|
@ -66,7 +66,7 @@ class HistoryChart {
|
||||||
let y = 0
|
let y = 0
|
||||||
|
|
||||||
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)
|
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height)
|
||||||
|
|
||||||
this.ctx.moveTo(0, y)
|
this.ctx.moveTo(0, y)
|
||||||
this.ctx.beginPath()
|
this.ctx.beginPath()
|
||||||
for (let point of this.data) {
|
for (let point of this.data) {
|
||||||
|
@ -75,6 +75,7 @@ class HistoryChart {
|
||||||
y = point[1] * this.canvas.height
|
y = point[1] * this.canvas.height
|
||||||
this.ctx.lineTo(x, y)
|
this.ctx.lineTo(x, y)
|
||||||
}
|
}
|
||||||
|
this.ctx.lineTo(this.canvas.width, y)
|
||||||
this.ctx.stroke()
|
this.ctx.stroke()
|
||||||
|
|
||||||
requestAnimationFrame(() => this.draw())
|
requestAnimationFrame(() => this.draw())
|
||||||
|
|
Loading…
Reference in New Issue