summaryrefslogtreecommitdiffstats
path: root/src/relative.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2014-02-14 22:25:12 +0100
committerwout <wout@impinc.co.uk>2014-02-14 22:25:12 +0100
commit8f9ccb16300142307b8ed6aed46c2a4984545600 (patch)
tree77040e5aa3802c7890d67aa0a62cdff432c2359f /src/relative.js
parenta7d61df3e8e065599c42752d60bb2f0190395080 (diff)
downloadsvg.js-8f9ccb16300142307b8ed6aed46c2a4984545600.tar.gz
svg.js-8f9ccb16300142307b8ed6aed46c2a4984545600.zip
Completely reworked `SVG.Text`, `SVG.TSpan` and `SVG.PathArray` and bumped to 1.0.0-rc.5
Diffstat (limited to 'src/relative.js')
-rwxr-xr-x[-rw-r--r--]src/relative.js34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/relative.js b/src/relative.js
index 2d02c08..7759bb9 100644..100755
--- a/src/relative.js
+++ b/src/relative.js
@@ -1,28 +1,16 @@
//
SVG.extend(SVG.Element, SVG.FX, {
- // Relative methods
- relative: function() {
- var b, e = this
-
- return {
- // Move over x axis
- x: function(x) {
- b = e.bbox()
-
- return e.x(b.x + (x || 0))
- }
- // Move over y axis
- , y: function(y) {
- b = e.bbox()
-
- return e.y(b.y + (y || 0))
- }
- // Move over x and y axes
- , move: function(x, y) {
- this.x(x)
- return this.y(y)
- }
- }
+ // Relative move over x axis
+ dx: function(x) {
+ return this.x(this.x() + x)
+ }
+ // Relative move over y axis
+, dy: function(y) {
+ return this.y(this.y() + y)
+ }
+ // Relative move over x and y axes
+, dmove: function(x, y) {
+ return this.dx(x).dy(y)
}
}) \ No newline at end of file