aboutsummaryrefslogtreecommitdiffstats
path: root/src/ellipse.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ellipse.js')
-rw-r--r--src/ellipse.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ellipse.js b/src/ellipse.js
index 1f9ef41..598c250 100644
--- a/src/ellipse.js
+++ b/src/ellipse.js
@@ -10,19 +10,19 @@ SVG.Ellipse.prototype = new SVG.Shape
SVG.extend(SVG.Ellipse, {
// Move over x-axis
x: function(x) {
- return this.cx(x + this.attrs.rx)
+ return x == null ? this.cx() - this.attr('rx') : this.cx(x + this.attr('rx'))
}
// Move over y-axis
, y: function(y) {
- return this.cy(y + this.attrs.ry)
+ return y == null ? this.cy() - this.attr('ry') : this.cy(y + this.attr('ry'))
}
// Move by center over x-axis
, cx: function(x) {
- return this.attr('cx', x)
+ return x == null ? this.attr('cx') : this.attr('cx', x / this.trans.scaleX)
}
// Move by center over y-axis
, cy: function(y) {
- return this.attr('cy', y)
+ return y == null ? this.attr('cy') : this.attr('cy', y / this.trans.scaleY)
}
// Custom size function
, size: function(width, height) {