diff --git a/src/shapes/polygon.class.js b/src/shapes/polygon.class.js index e832fd5d..003fc56a 100644 --- a/src/shapes/polygon.class.js +++ b/src/shapes/polygon.class.js @@ -124,7 +124,7 @@ } markup.push( - '\n' - ); - - return reviver ? reviver(markup.join('')) : markup.join(''); + return fabric.Polygon.prototype.toSVG.call(this, reviver); }, /* _TO_SVG_END_ */ @@ -125,22 +108,7 @@ * @param {CanvasRenderingContext2D} ctx Context to render on */ _render: function(ctx) { - var point; - ctx.beginPath(); - - if (this._applyPointOffset) { - if (!(this.group && this.group.type === 'path-group')) { - this._applyPointOffset(); - } - this._applyPointOffset = null; - } - - ctx.moveTo(this.points[0].x, this.points[0].y); - for (var i = 0, len = this.points.length; i < len; i++) { - point = this.points[i]; - ctx.lineTo(point.x, point.y); - } - + fabric.Polygon.prototype.commonRender.call(this, ctx); this._renderFill(ctx); this._renderStroke(ctx); },