From bca54806406f6731b1e4d44afad8eb8a63e4642b Mon Sep 17 00:00:00 2001 From: Samuel Asensi Date: Tue, 9 Oct 2018 22:04:18 +0200 Subject: [PATCH] Fix first mouse drag event is emitted twice (#1553) Closes #1447 --- src/tool/Tool.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tool/Tool.js b/src/tool/Tool.js index d063247e..e3c409e1 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -309,7 +309,9 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ // so there's always a delta. toolPoint = move ? tool._point : (tool._downPoint || pt); if (move) { - if (tool._moveCount && pt.equals(toolPoint)) { + // After first move event was emitted, tool._moveCount = 0, so + // we need to include 0 in this check. + if (tool._moveCount >= 0 && pt.equals(toolPoint)) { return false; } if (toolPoint && (minDistance != null || maxDistance != null)) {