demos/Collage/fabric.js
function(ctx, noTransform) {
      ctx.save();
      var m = this.transformMatrix;
      if (m) {
        ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
      }
      if (!noTransform) {
        this.transform(ctx);
      }
      // ctx.globalCompositeOperation = this.fillRule;

      if (this.overlayFill) {
        ctx.fillStyle = this.overlayFill;
      }
      else if (this.fill) {
        ctx.fillStyle = this.fill.toLiveGradient
          ? this.fill.toLiveGradient(ctx)
          : this.fill;
      }

      if (this.stroke) {
        ctx.strokeStyle = this.stroke;
      }
      ctx.beginPath();

      this._render(ctx);

      if (this.fill) {
        ctx.fill();
      }
      if (this.stroke) {
        ctx.strokeStyle = this.stroke;
        ctx.lineWidth = this.strokeWidth;
        ctx.lineCap = ctx.lineJoin = 'round';
        ctx.stroke();
      }
      if (!noTransform && this.active) {
        this.drawBorders(ctx);
        this.hideCorners || this.drawCorners(ctx);
      }
      ctx.restore();
    }
function(ctx, noTransform) {
      ctx.save();
      var m = this.transformMatrix;
      if (m) {
        ctx.transform(m[0], m[1], m[2], m[3], m[4], m[5]);
      }
      if (!noTransform) {
        this.transform(ctx);
      }
      // ctx.globalCompositeOperation = this.fillRule;

      if (this.overlayFill) {
        ctx.fillStyle = this.overlayFill;
      }
      else if (this.fill) {
        ctx.fillStyle = this.fill.toLiveGradient
          ? this.fill.toLiveGradient(ctx)
          : this.fill;
      }

      if (this.stroke) {
        ctx.strokeStyle = this.stroke;
      }
      ctx.beginPath();

      this._render(ctx);

      if (this.fill) {
        ctx.fill();
      }
      if (this.stroke) {
        ctx.strokeStyle = this.stroke;
        ctx.lineWidth = this.strokeWidth;
        ctx.lineCap = ctx.lineJoin = 'round';
        ctx.stroke();
      }
      if (!noTransform && this.active) {
        this.drawBorders(ctx);
        this.hideCorners || this.drawCorners(ctx);
      }
      ctx.restore();
    }
function ( ctx , noTransform ) { ctx . save ( ) ; var m = this . transformMatrix ; if ( m ) { ctx . transform ( m [ 0 ] , m [ 1 ] , m [ 2 ] , m [ 3 ] , m [ 4 ] , m [ 5 ] ) ; } if ( ! noTransform ) { this . transform ( ctx ) ; } // ctx.globalCompositeOperation = this.fillRule; if ( this . overlayFill ) { ctx . fillStyle = this . overlayFill ; } else if ( this . fill ) { ctx . fillStyle = this . fill . toLiveGradient ? this . fill . toLiveGradient ( ctx ) : this . fill ; } if ( this . stroke ) { ctx . strokeStyle = this . stroke ; } ctx . beginPath ( ) ; this . _render ( ctx ) ; if ( this . fill ) { ctx . fill ( ) ; } if ( this . stroke ) { ctx . strokeStyle = this . stroke ; ctx . lineWidth = this . strokeWidth ; ctx . lineCap = ctx . lineJoin = 'round' ; ctx . stroke ( ) ; } if ( ! noTransform && this . active ) { this . drawBorders ( ctx ) ; this . hideCorners || this . drawCorners ( ctx ) ; } ctx . restore ( ) ; }
Renders path on a specified context
@method render
@param {CanvasRenderingContext2D} ctx context to render path on
@param {Boolean} noTransform When true, context is not transformed
Renders path on a specified context