From 1422660f0e49c9dbf18b398022f0534546dd0c35 Mon Sep 17 00:00:00 2001 From: Antonio Pena Date: Tue, 7 Jun 2022 23:56:23 +0200 Subject: [PATCH] Fixed bug when the user zoom the page while drawing --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index bf0c122..d81ab9f 100644 --- a/src/index.js +++ b/src/index.js @@ -412,6 +412,10 @@ export default class CanvasDraw extends PureComponent { }; handleDrawMove = (e) => { + // Edge case when the user zoom the page while drawing + if (!this.interactionSM) { + this.interactionSM = new DefaultState(); + } this.interactionSM = this.interactionSM.handleDrawMove(e, this); this.mouseHasMoved = true; };