aboutsummaryrefslogtreecommitdiffstats
path: root/src/ellipse.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-20 21:31:17 +0100
committerwout <wout@impinc.co.uk>2012-12-20 21:31:17 +0100
commit675e347a10372a10ecdfd4fa6624c062f1ee7102 (patch)
treed36b605512862178deb07a1d58a11dc4e794921b /src/ellipse.js
parent7b5c91ba593fc673ec6d4a8d7dac4b26b1fac52f (diff)
downloadsvg.js-675e347a10372a10ecdfd4fa6624c062f1ee7102.tar.gz
svg.js-675e347a10372a10ecdfd4fa6624c062f1ee7102.zip
Added font element
Diffstat (limited to 'src/ellipse.js')
-rw-r--r--src/ellipse.js19
1 files changed, 9 insertions, 10 deletions
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)))
+ });
}
});