diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-05 14:14:31 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2017-03-05 14:14:31 +0100 |
commit | 901de657bdc832df1447b29648f27b83e7e4a910 (patch) | |
tree | 0199422d958974c196236822f53be93588307bb5 /src | |
parent | 020627905e5244e18b29664e052a16356824bfe3 (diff) | |
download | svg.js-901de657bdc832df1447b29648f27b83e7e4a910.tar.gz svg.js-901de657bdc832df1447b29648f27b83e7e4a910.zip |
`dx()/dy()` now accepts percentage values, too (#524)
but only if the value on the element is already percentage
Diffstat (limited to 'src')
-rw-r--r-- | src/sugar.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sugar.js b/src/sugar.js index 4110718..2d812e2 100644 --- a/src/sugar.js +++ b/src/sugar.js @@ -65,11 +65,11 @@ SVG.extend(SVG.Element, SVG.FX, { } // Relative move over x axis , dx: function(x) { - return this.x((this instanceof SVG.FX ? 0 : this.x()) + x, true) + return this.x(new SVG.Number(x).plus(this instanceof SVG.FX ? 0 : this.x()), true) } // Relative move over y axis , dy: function(y) { - return this.y((this instanceof SVG.FX ? 0 : this.y()) + y, true) + return this.y(new SVG.Number(y).plus(this instanceof SVG.FX ? 0 : this.y()), true) } // Relative move over x and y axes , dmove: function(x, y) { |