From e05a5a78e3483853f2936cd71d5c5662c8e4d565 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sat, 13 Sep 2014 16:38:42 +0200 Subject: [PATCH 1/3] Update polygon.class.js --- src/shapes/polygon.class.js | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) 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 +109,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); }, From ef18a5b9f1844d5f983c635cead2a801b3a87614 Mon Sep 17 00:00:00 2001 From: Andrea Bogazzi Date: Sat, 13 Sep 2014 16:48:38 +0200 Subject: [PATCH 3/3] Update polyline.class.js --- src/shapes/polyline.class.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/shapes/polyline.class.js b/src/shapes/polyline.class.js index 68145433..f57b670d 100644 --- a/src/shapes/polyline.class.js +++ b/src/shapes/polyline.class.js @@ -2,8 +2,7 @@ 'use strict'; - var fabric = global.fabric || (global.fabric = { }), - toFixed = fabric.util.toFixed; + var fabric = global.fabric || (global.fabric = { }); if (fabric.Polyline) { fabric.warn('fabric.Polyline is already defined');