demos/Collage/fabric.js
function () {
      this.clearContext(this.contextTop || this.contextContainer);

      if (this.overlayImage) {
        this.contextContainer.drawImage(this.overlayImage, 0, 0);
      }

      // we render the top context - last object
      if (this.selection && this._groupSelector) {
        this._drawSelection();
      }

      // delegate rendering to group selection if one exists
      // used for drawing selection borders/corners
      var activeGroup = this.getActiveGroup();
      if (activeGroup) {
        activeGroup.render(this.contextTop);
      }

      this.fire('after:render');

      return this;
    }
function () {
      this.clearContext(this.contextTop || this.contextContainer);

      if (this.overlayImage) {
        this.contextContainer.drawImage(this.overlayImage, 0, 0);
      }

      // we render the top context - last object
      if (this.selection && this._groupSelector) {
        this._drawSelection();
      }

      // delegate rendering to group selection if one exists
      // used for drawing selection borders/corners
      var activeGroup = this.getActiveGroup();
      if (activeGroup) {
        activeGroup.render(this.contextTop);
      }

      this.fire('after:render');

      return this;
    }
function ( ) { this . clearContext ( this . contextTop || this . contextContainer ) ; if ( this . overlayImage ) { this . contextContainer . drawImage ( this . overlayImage , 0 , 0 ) ; } // we render the top context - last object if ( this . selection && this . _groupSelector ) { this . _drawSelection ( ) ; } // delegate rendering to group selection if one exists // used for drawing selection borders/corners var activeGroup = this . getActiveGroup ( ) ; if ( activeGroup ) { activeGroup . render ( this . contextTop ) ; } this . fire ( 'after:render' ) ; return this ; }
Method to render only the top canvas.
Also used to render the group selection box.
@method renderTop
@return {fabric.Canvas} thisArg
@chainable
Method to render only the top canvas . Also used to render the group selection box .