summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-05-29 16:35:33 +0100
committerwout <wout@impinc.co.uk>2013-05-29 16:35:33 +0100
commit1f3eeddc4a188d0d9a1b581e2ce32106112bfdfc (patch)
treea2f4936c1026a812f52501364056efbae1987713 /src
parent13a9d3be70047bfb7284651735216f11c7a24965 (diff)
downloadsvg.js-1f3eeddc4a188d0d9a1b581e2ce32106112bfdfc.tar.gz
svg.js-1f3eeddc4a188d0d9a1b581e2ce32106112bfdfc.zip
Added translate() method
Diffstat (limited to 'src')
-rw-r--r--src/sugar.js11
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