summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/group.js11
-rw-r--r--src/sugar.js35
2 files changed, 23 insertions, 23 deletions
diff --git a/src/group.js b/src/group.js
index 3fc8f88..5e0df89 100644
--- a/src/group.js
+++ b/src/group.js
@@ -11,4 +11,15 @@ SVG.extend(SVG.G, {
return this.doc().defs()
}
+})
+
+SVG.extend(SVG.G, {
+ // Move using translate
+ move: function(x, y) {
+ return this.transform({
+ x: x
+ , y: y
+ })
+ }
+
}) \ No newline at end of file
diff --git a/src/sugar.js b/src/sugar.js
index e076491..42883e5 100644
--- a/src/sugar.js
+++ b/src/sugar.js
@@ -33,27 +33,29 @@ var _colorPrefix = function(type, attr) {
if (module) {
SVG.extend(module, {
// Rotation
- rotate: function(angle) {
+ rotate: function(deg, cx, cy) {
return this.transform({
- rotation: angle || 0
+ rotation: deg || 0
+ , cx: cx
+ , cy: cy
})
- },
+ }
// Skew
- skew: function(x, y) {
+ , skew: function(x, y) {
return this.transform({
- skewX: x || 0,
- skewY: y || 0
+ skewX: x || 0
+ , skewY: y || 0
})
- },
+ }
// Scale
- scale: function(x, y) {
+ , scale: function(x, y) {
return this.transform({
scaleX: x,
scaleY: y == null ? x : y
})
- },
+ }
// Opacity
- opacity: function(value) {
+ , opacity: function(value) {
return this.attr('opacity', value)
}
@@ -61,19 +63,6 @@ var _colorPrefix = function(type, attr) {
}
})
-if (SVG.G) {
- SVG.extend(SVG.G, {
- // Move using translate
- move: function(x, y) {
- return this.transform({
- x: x,
- y: y
- })
- }
-
- })
-}
-
if (SVG.Text) {
SVG.extend(SVG.Text, {
// Set font