diff options
author | wout <wout@impinc.co.uk> | 2014-08-01 20:40:49 +0200 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2014-08-01 20:40:49 +0200 |
commit | f0dc4d5ee03add261242743aa583c19d918f317c (patch) | |
tree | 2d480aed288eb180e53c3c0fba8623029478db8b /src/sugar.js | |
parent | c2d1b2916b38d111d8672826c1219ab891567798 (diff) | |
download | svg.js-f0dc4d5ee03add261242743aa583c19d918f317c.tar.gz svg.js-f0dc4d5ee03add261242743aa583c19d918f317c.zip |
Added SVG.Bare for creation of non-described elements
Diffstat (limited to 'src/sugar.js')
-rwxr-xr-x | src/sugar.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sugar.js b/src/sugar.js index cc01c00..4b7b232 100755 --- a/src/sugar.js +++ b/src/sugar.js @@ -59,6 +59,18 @@ SVG.extend(SVG.Element, SVG.FX, { , opacity: function(value) { return this.attr('opacity', value) } + // Relative move over x axis +, dx: function(x) { + return this.x((this.target || this).x() + x) + } + // Relative move over y axis +, dy: function(y) { + return this.y((this.target || this).y() + y) + } + // Relative move over x and y axes +, dmove: function(x, y) { + return this.dx(x).dy(y) + } }) SVG.extend(SVG.Rect, SVG.Ellipse, SVG.Circle, SVG.Gradient, SVG.FX, { |