aboutsummaryrefslogtreecommitdiffstats
path: root/src/sugar.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-08-01 20:40:49 +0200
committerwout <wout@impinc.co.uk>2014-08-01 20:40:49 +0200
commitf0dc4d5ee03add261242743aa583c19d918f317c (patch)
tree2d480aed288eb180e53c3c0fba8623029478db8b /src/sugar.js
parentc2d1b2916b38d111d8672826c1219ab891567798 (diff)
downloadsvg.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-xsrc/sugar.js12
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, {