demos/Collage/fabric.js
function(parsedAttributes) {
      if (parsedAttributes.left) {
        this.set('left', parsedAttributes.left + this.getWidth() / 2);
      }
      this.set('x', parsedAttributes.left || 0);
      if (parsedAttributes.top) {
        this.set('top', parsedAttributes.top + this.getHeight() / 2);
      }
      this.set('y', parsedAttributes.top || 0);
      return this;
    }
function(parsedAttributes) {
      if (parsedAttributes.left) {
        this.set('left', parsedAttributes.left + this.getWidth() / 2);
      }
      this.set('x', parsedAttributes.left || 0);
      if (parsedAttributes.top) {
        this.set('top', parsedAttributes.top + this.getHeight() / 2);
      }
      this.set('y', parsedAttributes.top || 0);
      return this;
    }
function ( parsedAttributes ) { if ( parsedAttributes . left ) { this . set ( 'left' , parsedAttributes . left + this . getWidth ( ) / 2 ) ; } this . set ( 'x' , parsedAttributes . left || 0 ) ; if ( parsedAttributes . top ) { this . set ( 'top' , parsedAttributes . top + this . getHeight ( ) / 2 ) ; } this . set ( 'y' , parsedAttributes . top || 0 ) ; return this ; }
since our coordinate system differs from that of SVG
since our coordinate system differs from that of SVG