diff options
Diffstat (limited to 'src/ellipse.js')
-rw-r--r-- | src/ellipse.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ellipse.js b/src/ellipse.js index 9e03277..41443b9 100644 --- a/src/ellipse.js +++ b/src/ellipse.js @@ -10,7 +10,7 @@ SVG.Ellipse.prototype = new SVG.Shape(); SVG.Ellipse.prototype.move = function(x, y) { this.attributes.x = x; this.attributes.y = y; - this._center(); + this.center(); return this; }; @@ -19,12 +19,12 @@ SVG.Ellipse.prototype.move = function(x, y) { SVG.Ellipse.prototype.size = function(w, h) { this.setAttribute('rx', w / 2); this.setAttribute('ry', h / 2); - this._center(); + this.center(); return this; }; -SVG.Ellipse.prototype._center = function() { - this.setAttribute('cx', (this.attributes.x || 0) + (this.attributes.rx || 0)); - this.setAttribute('cy', (this.attributes.y || 0) + (this.attributes.ry || 0)); +SVG.Ellipse.prototype.center = function(cx, cy) { + this.setAttribute('cx', cx || ((this.attributes.x || 0) + (this.attributes.rx || 0))); + this.setAttribute('cy', cy || ((this.attributes.y || 0) + (this.attributes.ry || 0))); };
\ No newline at end of file |