code: function calculateCanvasSize() {
      var width = view.getCanvasWidth();
      var _scale = docSize.x / width;
      var height = docSize.y / _scale;
  
      view.setCanvasHeight(height);
  
      canvasSize.x = width;
      canvasSize.y = height;
    }
docs: Calculates and sets the size of the mini canvas.