diff options
author | wout <wout@impinc.co.uk> | 2013-07-25 13:09:30 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-07-25 13:09:30 +0100 |
commit | 58f10a25dbee327f496eacbf7944a561708de5ea (patch) | |
tree | 89647de589f46d40aaf01258240f8d6ad9390322 /src/poly.js | |
parent | 494535622842ac8636a85c485b3057e8aa0dc5a7 (diff) | |
download | svg.js-58f10a25dbee327f496eacbf7944a561708de5ea.tar.gz svg.js-58f10a25dbee327f496eacbf7944a561708de5ea.zip |
Added SVG.Array and bumped to v0.29
Diffstat (limited to 'src/poly.js')
-rw-r--r-- | src/poly.js | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/poly.js b/src/poly.js index 8dd4696..74a5700 100644 --- a/src/poly.js +++ b/src/poly.js @@ -20,16 +20,10 @@ SVG.Polygon.prototype = new SVG.Shape SVG.extend(SVG.Polyline, SVG.Polygon, { // Private: Native plot _plot: function(p) { - if (Array.isArray(p)) { - var i, l, points = [] - - for (i = 0, l = p.length; i < l; i++) - points.push(p[i].join(',')) - - p = points.length > 0 ? points.join(' ') : '0,0' - } + if (Array.isArray(p)) + p = new SVG.Array(p, [[0,0]]) - return this.attr('points', p || '0,0') + return this.attr('points', p) } }) |