plot: prevent crash when there is only one point in array (issue #148)

This commit is contained in:
jean-emmanuel 2018-02-11 23:57:18 +01:00
parent e2be66f597
commit 03d5da9339

View file

@ -123,6 +123,8 @@ module.exports = class _plots_base extends Canvas {
}
if (points.length < 4) return
this.ctx.beginPath()
this.ctx.curve(points, this.smooth, Math.round(this.width/(points.length/2 - 1)))