From b0be5ff523334cd34fb08eef87de6eca5ebde81d Mon Sep 17 00:00:00 2001 From: raphael Date: Tue, 17 Nov 2020 00:18:00 +0100 Subject: [PATCH] fix drawing single point --- src/js/whiteboard.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/js/whiteboard.js b/src/js/whiteboard.js index 518d98a..7db2dd9 100644 --- a/src/js/whiteboard.js +++ b/src/js/whiteboard.js @@ -686,6 +686,9 @@ const whiteboard = { var steps = Math.ceil(length / 5); _this.ctx.beginPath(); _this.ctx.moveTo(x0, y0); + if (steps == 0) { + _this.ctx.lineTo(x0, y0); + } for (var i = 0; i < steps; i++) { var point = lanczosInterpolate(xm1, ym1, x0, y0, x1, y1, x2, y2, (i + 1) / steps); _this.ctx.lineTo(point[0], point[1]);