2019-10-04 in class

This commit is contained in:
Claudio Maggioni 2019-10-04 17:29:36 +02:00
parent c72515f5ae
commit d2fe8d9f90

View file

@ -45,10 +45,12 @@ class App {
this.canvas.addEventListener('mousemove', (e) => this.mousedown && this.draw(e));
const endPath = (e) => {
if (this.mousedown) {
this.ctx.lineTo(e.offsetX, e.offsetY);
this.ctx.stroke();
this.ctx.restore();
this.mousedown = false;
}
};
this.canvas.addEventListener('mouseup', endPath);