diff --git a/src/tool/Tool.js b/src/tool/Tool.js index 5fc04530..62d371a6 100644 --- a/src/tool/Tool.js +++ b/src/tool/Tool.js @@ -303,16 +303,16 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ // is reached. function update(minDistance, maxDistance) { var pt = point, - // Set toolPoint to the previous point for moves or downPoint for - // clicks, so mouseup has a delta spanning over the full drag. - // Use the current point if this is the first mousedown, so - // there's always a delta. - toolPoint = (move ? tool._point : tool._downPoint) || pt; + // Set toolPoint to the previous point for moves or downPoint + // for clicks, so mouseup has a delta spanning over the full + // drag. Use the current point if this is the first mousedown, + // so there's always a delta. + toolPoint = move ? tool._point : (tool._downPoint || pt); if (move) { if (tool._moveCount && pt.equals(toolPoint)) { return false; } - if (minDistance != null || maxDistance != null) { + if (toolPoint && (minDistance != null || maxDistance != null)) { var vector = pt.subtract(toolPoint), distance = vector.getLength(); if (distance < (minDistance || 0)) @@ -327,7 +327,7 @@ var Tool = PaperScopeItem.extend(/** @lends Tool# */{ tool._moveCount++; } tool._point = pt; - tool._lastPoint = toolPoint; + tool._lastPoint = toolPoint || pt; if (mouse.down) { tool._moveCount = -1; tool._downPoint = pt;