function mouseDownCallback(e) {
  var eventData = e.detail;
  var element = eventData.element;
  var options = (0, _toolOptions.getToolOptions)(toolType, element);

  if (e.isTouchEvent || (0, _isMouseButtonEnabled2.default)(eventData.which, options.mouseButtonMask)) {
    element.addEventListener(_events2.default.MOUSE_DRAG, dragCallback);
    element.addEventListener(_events2.default.TOUCH_DRAG, dragCallback);
    element.addEventListener(_events2.default.MOUSE_UP, mouseUpCallback);
    element.addEventListener(_events2.default.TOUCH_END, mouseUpCallback);
    element.addEventListener(_events2.default.MOUSE_CLICK, mouseUpCallback);

    element.addEventListener(_externalModules2.default.cornerstone.EVENTS.NEW_IMAGE, newImageCallback);

    // Ignore until next event
    drawZoomedElement(eventData);
    // On next frame
    window.requestAnimationFrame(function () {
      return drawMagnificationTool(eventData);
    });

    e.preventDefault();
    e.stopPropagation();
  }
}
/** Draw the magnifying glass on mouseDown, and begin tracking mouse movements */
Draw the magnifying glass on mouseDown, and begin tracking mouse movements
Draw the magnifying glass on mouseDown and begin tracking mouse movements
function mouseDownCallback(e) {
  var eventData = e.detail;
  var element = eventData.element;
  var options = (0, _toolOptions.getToolOptions)(toolType, element);
  if (e.isTouchEvent || (0, _isMouseButtonEnabled2.default)(eventData.which, options.mouseButtonMask)) {
    element.addEventListener(_events2.default.MOUSE_DRAG, dragCallback);
    element.addEventListener(_events2.default.TOUCH_DRAG, dragCallback);
    element.addEventListener(_events2.default.MOUSE_UP, mouseUpCallback);
    element.addEventListener(_events2.default.TOUCH_END, mouseUpCallback);
    element.addEventListener(_events2.default.MOUSE_CLICK, mouseUpCallback);
    element.addEventListener(_externalModules2.default.cornerstone.EVENTS.NEW_IMAGE, newImageCallback);
    drawZoomedElement(eventData);
    window.requestAnimationFrame(function () {
      return drawMagnificationTool(eventData);
    });
    e.preventDefault();
    e.stopPropagation();
  }
}
function mouseDownCallback ( e ) { var eventData = e . detail ; var element = eventData . element ; var options = ( 0 , _toolOptions . getToolOptions ) ( toolType , element ) ; if ( e . isTouchEvent || ( 0 , _isMouseButtonEnabled2 . default ) ( eventData . which , options . mouseButtonMask ) ) { element . addEventListener ( _events2 . default . MOUSE_DRAG , dragCallback ) ; element . addEventListener ( _events2 . default . TOUCH_DRAG , dragCallback ) ; element . addEventListener ( _events2 . default . MOUSE_UP , mouseUpCallback ) ; element . addEventListener ( _events2 . default . TOUCH_END , mouseUpCallback ) ; element . addEventListener ( _events2 . default . MOUSE_CLICK , mouseUpCallback ) ; element . addEventListener ( _externalModules2 . default . cornerstone . EVENTS . NEW_IMAGE , newImageCallback ) ; drawZoomedElement ( eventData ) ; window . requestAnimationFrame ( function ( ) { return drawMagnificationTool ( eventData ) ; } ) ; e . preventDefault ( ) ; e . stopPropagation ( ) ; } }
Draw the magnifying glass on mouseDown, and begin tracking mouse movements
Draw the magnifying glass on mouseDown and begin tracking mouse movements
// Ignore until next event // On next frame