function computeScaleBounds(eventData, canvasSize, imageSize, horizontalReduction, verticalReduction) {

  var canvasBounds = {
    left: 0,
    top: 0,
    width: canvasSize.width,
    height: canvasSize.height
  };

  var hReduction = horizontalReduction * Math.min(1000, canvasSize.width);
  var vReduction = verticalReduction * Math.min(1000, canvasSize.height);

  canvasBounds = {
    left: canvasBounds.left + hReduction,
    top: canvasBounds.top + vReduction,
    width: canvasBounds.width - 2 * hReduction,
    height: canvasBounds.height - 2 * vReduction
  };

  return {
    topLeft: {
      x: canvasBounds.left,
      y: canvasBounds.top
    },
    bottomRight: {
      x: canvasBounds.left + canvasBounds.width,
      y: canvasBounds.top + canvasBounds.height
    }
  };
}
// Computes the max bound for scales on the image
Computes the max bound for scales on the image
Computes the max bound for scales on the image
function computeScaleBounds(eventData, canvasSize, imageSize, horizontalReduction, verticalReduction) {
  var canvasBounds = {
    left: 0,
    top: 0,
    width: canvasSize.width,
    height: canvasSize.height
  };
  var hReduction = horizontalReduction * Math.min(1000, canvasSize.width);
  var vReduction = verticalReduction * Math.min(1000, canvasSize.height);
  canvasBounds = {
    left: canvasBounds.left + hReduction,
    top: canvasBounds.top + vReduction,
    width: canvasBounds.width - 2 * hReduction,
    height: canvasBounds.height - 2 * vReduction
  };
  return {
    topLeft: {
      x: canvasBounds.left,
      y: canvasBounds.top
    },
    bottomRight: {
      x: canvasBounds.left + canvasBounds.width,
      y: canvasBounds.top + canvasBounds.height
    }
  };
}
function computeScaleBounds ( eventData , canvasSize , imageSize , horizontalReduction , verticalReduction ) { var canvasBounds = { left : 0 , top : 0 , width : canvasSize . width , height : canvasSize . height } ; var hReduction = horizontalReduction * Math . min ( 1000 , canvasSize . width ) ; var vReduction = verticalReduction * Math . min ( 1000 , canvasSize . height ) ; canvasBounds = { left : canvasBounds . left + hReduction , top : canvasBounds . top + vReduction , width : canvasBounds . width - 2 * hReduction , height : canvasBounds . height - 2 * vReduction } ; return { topLeft : { x : canvasBounds . left , y : canvasBounds . top } , bottomRight : { x : canvasBounds . left + canvasBounds . width , y : canvasBounds . top + canvasBounds . height } } ; }
Computes the max bound for scales on the image
Computes the max bound for scales on the image