function modifyHandle(element, nearby, toolData) {
  var config = freehand.getConfiguration();
  var handleNearby = nearby.handleNearby;
  var toolIndex = nearby.toolIndex;

  element.removeEventListener(_events2.default.MOUSE_MOVE, mouseMoveCallback);

  config.dragOrigin = {
    x: toolData.data[toolIndex].handles[handleNearby].x,
    y: toolData.data[toolIndex].handles[handleNearby].y
  };

  // Begin drag edit - call mouseUpCallback at end of drag or straight away if just a click.
  element.addEventListener(_events2.default.MOUSE_UP, mouseUpCallback);
  element.addEventListener(_events2.default.MOUSE_CLICK, mouseUpCallback);
  element.addEventListener(_events2.default.MOUSE_DRAG, mouseDragCallback);

  config.modifying = true;
  config.currentHandle = handleNearby;
  config.currentTool = toolIndex;
}
/**
* Event handler called by mouseDownPassive which modifies a tool's handle.
*
* @param {Object} element - The element associated with the event.
* @param {Object} nearby - Object containing information about a nearby handle.
* @param {Object} toolData - The data associated with the tool.
*/
Event handler called by mouseDownPassive which modifies a tool's handle.
Event handler called by mouseDownPassive which modifies a tool ' s handle .
function modifyHandle(element, nearby, toolData) {
  var config = freehand.getConfiguration();
  var handleNearby = nearby.handleNearby;
  var toolIndex = nearby.toolIndex;
  element.removeEventListener(_events2.default.MOUSE_MOVE, mouseMoveCallback);
  config.dragOrigin = {
    x: toolData.data[toolIndex].handles[handleNearby].x,
    y: toolData.data[toolIndex].handles[handleNearby].y
  };
  element.addEventListener(_events2.default.MOUSE_UP, mouseUpCallback);
  element.addEventListener(_events2.default.MOUSE_CLICK, mouseUpCallback);
  element.addEventListener(_events2.default.MOUSE_DRAG, mouseDragCallback);
  config.modifying = true;
  config.currentHandle = handleNearby;
  config.currentTool = toolIndex;
}
function modifyHandle ( element , nearby , toolData ) { var config = freehand . getConfiguration ( ) ; var handleNearby = nearby . handleNearby ; var toolIndex = nearby . toolIndex ; element . removeEventListener ( _events2 . default . MOUSE_MOVE , mouseMoveCallback ) ; config . dragOrigin = { x : toolData . data [ toolIndex ] . handles [ handleNearby ] . x , y : toolData . data [ toolIndex ] . handles [ handleNearby ] . y } ; element . addEventListener ( _events2 . default . MOUSE_UP , mouseUpCallback ) ; element . addEventListener ( _events2 . default . MOUSE_CLICK , mouseUpCallback ) ; element . addEventListener ( _events2 . default . MOUSE_DRAG , mouseDragCallback ) ; config . modifying = true ; config . currentHandle = handleNearby ; config . currentTool = toolIndex ; }
Event handler called by mouseDownPassive which modifies a tool's handle.
Event handler called by mouseDownPassive which modifies a tool ' s handle .
// Begin drag edit - call mouseUpCallback at end of drag or straight away if just a click.