aboutsummaryrefslogtreecommitdiffstats
path: root/src/sugar.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2012-12-19 13:22:07 +0100
committerwout <wout@impinc.co.uk>2012-12-19 13:22:07 +0100
commitdab421143cf719370cb3739d07e3e411d555cf3c (patch)
tree2ca44dc3130c2bd9da15465a5e46b01adf2f7061 /src/sugar.js
parent877c953761e9118753a593ec1ebeb1d523aecb5b (diff)
downloadsvg.js-dab421143cf719370cb3739d07e3e411d555cf3c.tar.gz
svg.js-dab421143cf719370cb3739d07e3e411d555cf3c.zip
Updated Readme
Diffstat (limited to 'src/sugar.js')
-rw-r--r--src/sugar.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sugar.js b/src/sugar.js
index 9b5b482..a9e1458 100644
--- a/src/sugar.js
+++ b/src/sugar.js
@@ -38,6 +38,7 @@ SVG.extend(SVG.Element, {
// rotation
rotate: function(o) {
var b = this.bbox();
+
if (o.x == null) o.x = b.cx;
if (o.y == null) o.y = b.cy;
@@ -47,3 +48,19 @@ SVG.extend(SVG.Element, {
}
});
+
+// Add group-specific functions
+SVG.extend(SVG.G, {
+
+ // move using translate
+ move: function(x, y) {
+ this.transform('translate(' + x + ' ' + y + ')', true);
+
+ return this;
+ }
+
+});
+
+
+
+