aboutsummaryrefslogtreecommitdiffstats
path: root/src/circle.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-18 19:54:12 +0100
committerwout <wout@impinc.co.uk>2012-12-18 19:54:12 +0100
commit1293edb66a5263f8f7064f16f11cbf6b8f550800 (patch)
treea336fb50db98d52ec8151b494bfa7762128c170e /src/circle.js
parentecc7c2b21cc484a0a57cd7df02a533c65f7bde97 (diff)
downloadsvg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.tar.gz
svg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.zip
Separated core from optional libraries
Diffstat (limited to 'src/circle.js')
-rw-r--r--src/circle.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/circle.js b/src/circle.js
index 9576568..1fe95e5 100644
--- a/src/circle.js
+++ b/src/circle.js
@@ -18,20 +18,20 @@ SVG.extend(SVG.Circle, {
return this;
},
- // custom size function
- size: function(w, h) {
+ // custom size function (no height value here!)
+ size: function(w) {
this.attr('r', w / 2);
this.center();
return this;
},
- // private: center
- center: function(cx, cy) {
+ // position element by its center
+ center: function(x, y) {
var r = this.attrs.r || 0;
- this.attr('cx', cx || ((this.attrs.x || 0) + r));
- this.attr('cy', cy || ((this.attrs.y || 0) + r));
+ this.attr('cx', x || ((this.attrs.x || 0) + r));
+ this.attr('cy', y || ((this.attrs.y || 0) + r));
}
}); \ No newline at end of file