docs: function(ctx) {
        if (!this.hasControls) return;
  
        var size = this.cornersize,
            size2 = size / 2,
            strokeWidth2 = this.strokeWidth / 2,
            left = -(this.width / 2),
            top = -(this.height / 2),
            _left,
            _top,
            sizeX = size / this.scaleX,
            sizeY = size / this.scaleY,
            paddingX = this.padding / this.scaleX,
            paddingY = this.padding / this.scaleY,
            scaleOffsetY = size2 / this.scaleY,
            scaleOffsetX = size2 / this.scaleX,
            scaleOffsetSizeX = (size2 - size) / this.scaleX,
            scaleOffsetSizeY = (size2 - size) / this.scaleY,
            height = this.height,
            width = this.width,
            methodName = this.transparentCorners ? 'strokeRect' : 'fillRect';
  
        ctx.save();
  
        ctx.lineWidth = 1 / Math.max(this.scaleX, this.scaleY);
  
        ctx.globalAlpha = this.isMoving ? this.borderOpacityWhenMoving : 1;
        ctx.strokeStyle = ctx.fillStyle = this.cornerColor;
  
        // top-left
        _left = left - scaleOffsetX - strokeWidth2 - paddingX;
        _top = top - scaleOffsetY - strokeWidth2 - paddingY;
  
        ctx.clearRect(_left, _top, sizeX, sizeY);
        ctx[methodName](_left, _top, sizeX, sizeY);
  
        // top-right
        _left = left + width - scaleOffsetX + strokeWidth2 + paddingX;
        _top = top - scaleOffsetY - strokeWidth2 - paddingY;
  
        ctx.clearRect(_left, _top, sizeX, sizeY);
        ctx[methodName](_left, _top, sizeX, sizeY);
  
        // bottom-left
        _left = left - scaleOffsetX - strokeWidth2 - paddingX;
        _top = top + height + scaleOffsetSizeY + strokeWidth2 + paddingY;
  
        ctx.clearRect(_left, _top, sizeX, sizeY);
        ctx[methodName](_left, _top, sizeX, sizeY);
  
        // bottom-right
        _left = left + width + scaleOffsetSizeX + strokeWidth2 + paddingX;
        _top = top + height + scaleOffsetSizeY + strokeWidth2 + paddingY;
  
        ctx.clearRect(_left, _top, sizeX, sizeY);
        ctx[methodName](_left, _top, sizeX, sizeY);
  
        if (!this.lockUniScaling) {
          // middle-top
          _left = left + width/2 - scaleOffsetX;
          _top = top - scaleOffsetY - strokeWidth2 - paddingY;
  
          ctx.clearRect(_left, _top, sizeX, sizeY);
          ctx[methodName](_left, _top, sizeX, sizeY);
  
          // middle-bottom
          _left = left + width/2 - scaleOffsetX;
          _top = top + height + scaleOffsetSizeY + strokeWidth2 + paddingY;
  
          ctx.clearRect(_left, _top, sizeX, sizeY);
          ctx[methodName](_left, _top, sizeX, sizeY);
  
          // middle-right
          _left = left + width + scaleOffsetSizeX + strokeWidth2 + paddingX;
          _top = top + height/2 - scaleOffsetY;
  
          ctx.clearRect(_left, _top, sizeX, sizeY);
          ctx[methodName](_left, _top, sizeX, sizeY);
  
          // middle-left
          _left = left - scaleOffsetX - strokeWidth2 - paddingX;
          _top = top + height/2 - scaleOffsetY;
  
          ctx.clearRect(_left, _top, sizeX, sizeY);
          ctx[methodName](_left, _top, sizeX, sizeY);
        }
  
        // middle-top-rotate
        if (this.hasRotatingPoint) {
  
          _left = left + width/2 - scaleOffsetX;
  
          _top = this.flipY ?
            (top + height + (this.rotatingPointOffset / this.scaleY) - sizeY/2 + strokeWidth2 + paddingY)
            : (top - (this.rotatingPointOffset / this.scaleY) - sizeY/2 - strokeWidth2 - paddingY);
  
          ctx.clearRect(_left, _top, sizeX, sizeY);
          ctx[methodName](_left, _top, sizeX, sizeY);
        }
  
        ctx.restore();
  
        return this;
      }