diff options
author | wout <wout@impinc.co.uk> | 2013-05-29 16:35:33 +0100 |
---|---|---|
committer | wout <wout@impinc.co.uk> | 2013-05-29 16:35:33 +0100 |
commit | 1f3eeddc4a188d0d9a1b581e2ce32106112bfdfc (patch) | |
tree | a2f4936c1026a812f52501364056efbae1987713 /src | |
parent | 13a9d3be70047bfb7284651735216f11c7a24965 (diff) | |
download | svg.js-1f3eeddc4a188d0d9a1b581e2ce32106112bfdfc.tar.gz svg.js-1f3eeddc4a188d0d9a1b581e2ce32106112bfdfc.zip |
Added translate() method
Diffstat (limited to 'src')
-rw-r--r-- | src/sugar.js | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sugar.js b/src/sugar.js index d063207..9630b3d 100644 --- a/src/sugar.js +++ b/src/sugar.js @@ -50,8 +50,15 @@ SVG.extend(SVG.Element, SVG.FX, { // Scale , scale: function(x, y) { return this.transform({ - scaleX: x, - scaleY: y == null ? x : y + scaleX: x + , scaleY: y == null ? x : y + }) + } + // Translate +, translate: function(x, y) { + return this.transform({ + x: x + , y: y }) } // Matrix |