From 675e347a10372a10ecdfd4fa6624c062f1ee7102 Mon Sep 17 00:00:00 2001 From: wout Date: Thu, 20 Dec 2012 21:31:17 +0100 Subject: Added font element --- src/ellipse.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/ellipse.js') diff --git a/src/ellipse.js b/src/ellipse.js index adc1fd6..d897969 100644 --- a/src/ellipse.js +++ b/src/ellipse.js @@ -13,24 +13,23 @@ SVG.extend(SVG.Ellipse, { move: function(x, y) { this.attrs.x = x; this.attrs.y = y; - this.center(); - - return this; + + return this.center(); }, // custom size function size: function(w, h) { - this.attr('rx', w / 2); - this.attr('ry', h / 2); - this.center(); - - return this; + return this. + attr({ rx: w / 2, ry: h / 2 }). + center(); }, // position element by its center center: function(x, y) { - this.attr('cx', x || ((this.attrs.x || 0) + (this.attrs.rx || 0))); - this.attr('cy', y || ((this.attrs.y || 0) + (this.attrs.ry || 0))); + return this.attr({ + cx: (x || ((this.attrs.x || 0) + (this.attrs.rx || 0))), + cy: (y || ((this.attrs.y || 0) + (this.attrs.ry || 0))) + }); } }); -- cgit v1.2.3