demos/Collage/fabric.js
function(point) {

      var halfWidth = this.get('width') / 2,
          halfHeight = this.get('height') / 2,
          centerX = this.get('left'),
          centerY = this.get('top');

      return  centerX - halfWidth < point.x &&
              centerX + halfWidth > point.x &&
              centerY - halfHeight < point.y &&
              centerY + halfHeight > point.y;
    }
function(point) {

      var halfWidth = this.get('width') / 2,
          halfHeight = this.get('height') / 2,
          centerX = this.get('left'),
          centerY = this.get('top');

      return  centerX - halfWidth < point.x &&
              centerX + halfWidth > point.x &&
              centerY - halfHeight < point.y &&
              centerY + halfHeight > point.y;
    }
function ( point ) { var halfWidth = this . get ( 'width' ) / 2 , halfHeight = this . get ( 'height' ) / 2 , centerX = this . get ( 'left' ) , centerY = this . get ( 'top' ) ; return centerX - halfWidth < point . x && centerX + halfWidth > point . x && centerY - halfHeight < point . y && centerY + halfHeight > point . y ; }
Checks if point is contained within the group
@method containsPoint
@param {fabric.Point} point point with `x` and `y` properties
@return {Boolean} true if point is contained within group
Checks if point is contained within the group