function invalidHandlePencilMode(data, mousePoint) {
  var config = freehand.getConfiguration();
  var dataHandles = data.handles;

  if (_externalModules2.default.cornerstoneMath.point.distance(dataHandles[0], mousePoint) < config.spacing) {
    data.canComplete = true;

    return false;
  }

  data.canComplete = false;

  // Compare with all other handles appart from the last one
  for (var i = 1; i < dataHandles.length - 1; i++) {
    if (_externalModules2.default.cornerstoneMath.point.distance(dataHandles[i], mousePoint) < config.spacing) {
      return true;
    }
  }

  return false;
}
/**
* Returns true if the mouse position is far enough from previous points (in pencilMode).
*
* @param {Object} data - data object associated with the tool.
* @param {Object} mousePoint - the position of the mouse cursor.
* @return {Boolean}
*/
Returns true if the mouse position is far enough from previous points (in pencilMode).
Returns true if the mouse position is far enough from previous points ( in pencilMode ) .
function invalidHandlePencilMode(data, mousePoint) {
  var config = freehand.getConfiguration();
  var dataHandles = data.handles;
  if (_externalModules2.default.cornerstoneMath.point.distance(dataHandles[0], mousePoint) < config.spacing) {
    data.canComplete = true;
    return false;
  }
  data.canComplete = false;
  for (var i = 1; i < dataHandles.length - 1; i++) {
    if (_externalModules2.default.cornerstoneMath.point.distance(dataHandles[i], mousePoint) < config.spacing) {
      return true;
    }
  }
  return false;
}
function invalidHandlePencilMode ( data , mousePoint ) { var config = freehand . getConfiguration ( ) ; var dataHandles = data . handles ; if ( _externalModules2 . default . cornerstoneMath . point . distance ( dataHandles [ 0 ] , mousePoint ) < config . spacing ) { data . canComplete = true ; return false ; } data . canComplete = false ; for ( var i = 1 ; i < dataHandles . length - 1 ; i ++ ) { if ( _externalModules2 . default . cornerstoneMath . point . distance ( dataHandles [ i ] , mousePoint ) < config . spacing ) { return true ; } } return false ; }
Returns true if the mouse position is far enough from previous points (in pencilMode).
Returns true if the mouse position is far enough from previous points ( in pencilMode ) .
// Compare with all other handles appart from the last one