diff options
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 |