demos/Collage/fabric.js
function (object) {
      removeFromArray(this._objects, object);
      if (this.getActiveObject() === object) {

        // removing active object should fire "selection:cleared" events
        this.fire('before:selection:cleared', { target: object });
        this.discardActiveObject();
        this.fire('selection:cleared');
      }
      this.renderAll();
      return object;
    }
function (object) {
      removeFromArray(this._objects, object);
      if (this.getActiveObject() === object) {

        // removing active object should fire "selection:cleared" events
        this.fire('before:selection:cleared', { target: object });
        this.discardActiveObject();
        this.fire('selection:cleared');
      }
      this.renderAll();
      return object;
    }
function ( object ) { removeFromArray ( this . _objects , object ) ; if ( this . getActiveObject ( ) === object ) { // removing active object should fire "selection:cleared" events this . fire ( 'before:selection:cleared' , { target : object } ) ; this . discardActiveObject ( ) ; this . fire ( 'selection:cleared' ) ; } this . renderAll ( ) ; return object ; }
Removes an object from canvas and returns it
@method remove
@param object {Object} Object to remove
@return {Object} removed object
Removes an object from canvas and returns it