diff options
author | wout <wout@impinc.co.uk> | 2013-01-04 19:12:16 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-01-04 19:12:16 +0100 |
commit | 2380c67d4ddded556617760b4b3cb38a1d7758e2 (patch) | |
tree | c0bd5ee57a4c83e5d8860becba7766188344eda3 /src/poly.js | |
parent | 40de19951d0a4218ee2625fa9a1a69f04e79692d (diff) | |
download | svg.js-2380c67d4ddded556617760b4b3cb38a1d7758e2.tar.gz svg.js-2380c67d4ddded556617760b4b3cb38a1d7758e2.zip |
Made code more readable and included docs
Diffstat (limited to 'src/poly.js')
-rw-r--r-- | src/poly.js | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/poly.js b/src/poly.js index e504b4c..8867604 100644 --- a/src/poly.js +++ b/src/poly.js @@ -1,37 +1,34 @@ - SVG.Poly = { - // set polygon data with default zero point if no data is passed - plot: function(p) { - return this.attr('points', p || '0,0'); + // Set polygon data with default zero point if no data is passed + plot: function(points) { + return this.attr('points', points || '0,0'); }, - - // move path using translate + // Move path using translate move: function(x, y) { - return this.transform({ x: x, y: y }); + return this.transform({ + x: x, + y: y + }); } }; - - SVG.Polyline = function Polyline() { this.constructor.call(this, SVG.create('polyline')); }; -// inherit from SVG.Shape +// Inherit from SVG.Shape SVG.Polyline.prototype = new SVG.Shape(); // Add polygon-specific functions SVG.extend(SVG.Polyline, SVG.Poly); - - SVG.Polygon = function Polygon() { this.constructor.call(this, SVG.create('polygon')); }; -// inherit from SVG.Shape +// Inherit from SVG.Shape SVG.Polygon.prototype = new SVG.Shape(); // Add polygon-specific functions |