aboutsummaryrefslogtreecommitdiffstats
path: root/src/ellipse.js
diff options
context:
space:
mode:
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)))
+ });
}
});