function deletePoint(eventData, deleteInfo) {
  var toolData = (0, _toolState.getToolState)(eventData.element, toolType);

  if (toolData === undefined) {
    return;
  }

  var deleteHandle = deleteInfo.handleIndex;
  var toolIndex = deleteInfo.toolIndex;

  // Get the toolData from insertInfo
  var data = toolData.data[toolIndex];

  // Only allow delete if > 3 points
  if (data.handles.length <= 3) {
    return;
  }

  // Link the line of the previous handle to the one after handles[deleteHandle];
  if (deleteHandle === data.handles.length - 1) {
    data.handles[deleteHandle - 1].lines.pop();
    data.handles[deleteHandle - 1].lines.push(data.handles[0]);
  } else if (deleteHandle === 0) {
    data.handles[data.handles.length - 1].lines.pop();
    data.handles[data.handles.length - 1].lines.push(data.handles[deleteHandle + 1]);
  } else {
    data.handles[deleteHandle - 1].lines.pop();
    data.handles[deleteHandle - 1].lines.push(data.handles[deleteHandle + 1]);
  }

  // Remove the handle
  data.handles.splice(deleteHandle, 1);

  data.invalidated = true;
  data.active = true;
  data.highlight = true;

  // Force onImageRendered to fire
  _externalModules2.default.cornerstone.updateImage(eventData.element);
}
/**
* Deletes a point from a freehand tool.
*
* @param {Object} eventData - The data object associated with the event.
* @param {Object} deleteInfo - Object containing information about which point to delete.
*/
Deletes a point from a freehand tool.
Deletes a point from a freehand tool .
function deletePoint(eventData, deleteInfo) {
  var toolData = (0, _toolState.getToolState)(eventData.element, toolType);
  if (toolData === undefined) {
    return;
  }
  var deleteHandle = deleteInfo.handleIndex;
  var toolIndex = deleteInfo.toolIndex;
  var data = toolData.data[toolIndex];
  if (data.handles.length <= 3) {
    return;
  }
  if (deleteHandle === data.handles.length - 1) {
    data.handles[deleteHandle - 1].lines.pop();
    data.handles[deleteHandle - 1].lines.push(data.handles[0]);
  } else if (deleteHandle === 0) {
    data.handles[data.handles.length - 1].lines.pop();
    data.handles[data.handles.length - 1].lines.push(data.handles[deleteHandle + 1]);
  } else {
    data.handles[deleteHandle - 1].lines.pop();
    data.handles[deleteHandle - 1].lines.push(data.handles[deleteHandle + 1]);
  }
  data.handles.splice(deleteHandle, 1);
  data.invalidated = true;
  data.active = true;
  data.highlight = true;
  _externalModules2.default.cornerstone.updateImage(eventData.element);
}
function deletePoint ( eventData , deleteInfo ) { var toolData = ( 0 , _toolState . getToolState ) ( eventData . element , toolType ) ; if ( toolData === undefined ) { return ; } var deleteHandle = deleteInfo . handleIndex ; var toolIndex = deleteInfo . toolIndex ; var data = toolData . data [ toolIndex ] ; if ( data . handles . length <= 3 ) { return ; } if ( deleteHandle === data . handles . length - 1 ) { data . handles [ deleteHandle - 1 ] . lines . pop ( ) ; data . handles [ deleteHandle - 1 ] . lines . push ( data . handles [ 0 ] ) ; } else if ( deleteHandle === 0 ) { data . handles [ data . handles . length - 1 ] . lines . pop ( ) ; data . handles [ data . handles . length - 1 ] . lines . push ( data . handles [ deleteHandle + 1 ] ) ; } else { data . handles [ deleteHandle - 1 ] . lines . pop ( ) ; data . handles [ deleteHandle - 1 ] . lines . push ( data . handles [ deleteHandle + 1 ] ) ; } data . handles . splice ( deleteHandle , 1 ) ; data . invalidated = true ; data . active = true ; data . highlight = true ; _externalModules2 . default . cornerstone . updateImage ( eventData . element ) ; }
Deletes a point from a freehand tool.
Deletes a point from a freehand tool .
// Get the toolData from insertInfo // Only allow delete if > 3 points // Link the line of the previous handle to the one after handles[deleteHandle]; // Remove the handle // Force onImageRendered to fire