function checkHandlesPolygonMode(data) {
  var config = freehand.getConfiguration();
  var mousePoint = config.mouseLocation.handles.start;
  var dataHandles = data.handles;
  var invalidHandlePlacement = false;

  data.canComplete = false;

  var mouseAtOriginHandle = _externalModules2.default.cornerstoneMath.point.distance(dataHandles[0], mousePoint) < config.spacing;

  if (mouseAtOriginHandle && !_freeHandIntersect2.default.end(dataHandles)) {
    data.canComplete = true;
    invalidHandlePlacement = false;
  } else {
    invalidHandlePlacement = _freeHandIntersect2.default.newHandle(mousePoint, dataHandles);
  }

  return invalidHandlePlacement;
}
/**
* Returns true if the proposed location of a new handle is invalid (in polygon mode).
*
* @param {Object} data - data object associated with the tool.
* @return {Boolean}
*/
Returns true if the proposed location of a new handle is invalid (in polygon mode).
Returns true if the proposed location of a new handle is invalid ( in polygon mode ) .
function checkHandlesPolygonMode(data) {
  var config = freehand.getConfiguration();
  var mousePoint = config.mouseLocation.handles.start;
  var dataHandles = data.handles;
  var invalidHandlePlacement = false;
  data.canComplete = false;
  var mouseAtOriginHandle = _externalModules2.default.cornerstoneMath.point.distance(dataHandles[0], mousePoint) < config.spacing;
  if (mouseAtOriginHandle && !_freeHandIntersect2.default.end(dataHandles)) {
    data.canComplete = true;
    invalidHandlePlacement = false;
  } else {
    invalidHandlePlacement = _freeHandIntersect2.default.newHandle(mousePoint, dataHandles);
  }
  return invalidHandlePlacement;
}
function checkHandlesPolygonMode ( data ) { var config = freehand . getConfiguration ( ) ; var mousePoint = config . mouseLocation . handles . start ; var dataHandles = data . handles ; var invalidHandlePlacement = false ; data . canComplete = false ; var mouseAtOriginHandle = _externalModules2 . default . cornerstoneMath . point . distance ( dataHandles [ 0 ] , mousePoint ) < config . spacing ; if ( mouseAtOriginHandle && ! _freeHandIntersect2 . default . end ( dataHandles ) ) { data . canComplete = true ; invalidHandlePlacement = false ; } else { invalidHandlePlacement = _freeHandIntersect2 . default . newHandle ( mousePoint , dataHandles ) ; } return invalidHandlePlacement ; }
Returns true if the proposed location of a new handle is invalid (in polygon mode).
Returns true if the proposed location of a new handle is invalid ( in polygon mode ) .