diff options
author | wout <wout@impinc.co.uk> | 2012-12-18 19:54:12 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2012-12-18 19:54:12 +0100 |
commit | 1293edb66a5263f8f7064f16f11cbf6b8f550800 (patch) | |
tree | a336fb50db98d52ec8151b494bfa7762128c170e /src/circle.js | |
parent | ecc7c2b21cc484a0a57cd7df02a533c65f7bde97 (diff) | |
download | svg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.tar.gz svg.js-1293edb66a5263f8f7064f16f11cbf6b8f550800.zip |
Separated core from optional libraries
Diffstat (limited to 'src/circle.js')
-rw-r--r-- | src/circle.js | 12 |
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 |