diff options
author | wout <wout@impinc.co.uk> | 2013-02-20 19:10:03 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-02-20 19:10:03 +0100 |
commit | ae878fd63077d4c95f2de9053a6f0951b55239eb (patch) | |
tree | 5dba7bd42a8b5702faeb6cc12d2b4d4099841e51 /src/ellipse.js | |
parent | 5020240e4029a61a9620f21d7be4d9764e7723d1 (diff) | |
download | svg.js-ae878fd63077d4c95f2de9053a6f0951b55239eb.tar.gz svg.js-ae878fd63077d4c95f2de9053a6f0951b55239eb.zip |
Created separate classes for SVG.ViewBox anSVG.BBox0.6
Diffstat (limited to 'src/ellipse.js')
-rw-r--r-- | src/ellipse.js | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ellipse.js b/src/ellipse.js index ad3e02e..f9398cf 100644 --- a/src/ellipse.js +++ b/src/ellipse.js @@ -1,36 +1,36 @@ // -SVG.Ellipse = function Ellipse() { - this.constructor.call(this, SVG.create('ellipse')); -}; +SVG.Ellipse = function() { + this.constructor.call(this, SVG.create('ellipse')) +} // Inherit from SVG.Shape -SVG.Ellipse.prototype = new SVG.Shape(); +SVG.Ellipse.prototype = new SVG.Shape() // SVG.extend(SVG.Ellipse, { // Custom move function move: function(x, y) { - this.attrs.x = x; - this.attrs.y = y; + this.attrs.x = x + this.attrs.y = y - return this.center(); + return this.center() }, // Custom size function size: function(width, height) { return this. attr({ rx: width / 2, ry: (height != null ? height : width) / 2 }). - center(); + center() }, // Custom center function center: function(x, y) { return this.attr({ cx: x || (this.attrs.x || 0) + (this.attrs.rx || 0), cy: y || (this.attrs.y || 0) + (this.attrs.ry || 0) - }); + }) } -}); +}) // Usage: -// draw.ellipse(200, 100);
\ No newline at end of file +// draw.ellipse(200, 100)
\ No newline at end of file |