Fix first mouse drag event is emitted twice (#1553)

Closes #1447
This commit is contained in:
Samuel Asensi 2018-10-09 22:04:18 +02:00 committed by Jürg Lehni
parent dfe4397a96
commit bca5480640

View file

@ -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)) {