From 1293edb66a5263f8f7064f16f11cbf6b8f550800 Mon Sep 17 00:00:00 2001 From: wout Date: Tue, 18 Dec 2012 19:54:12 +0100 Subject: Separated core from optional libraries --- src/circle.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/circle.js') 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 -- cgit v1.2.3