summaryrefslogtreecommitdiffstats
path: root/src/relative.js
blob: 2d02c081af12eaa248535307813b33717eb221f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//
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)
      }
    }
  }

})