aboutsummaryrefslogtreecommitdiffstats
path: root/src/sugar.js
diff options
context:
space:
mode:
authorwout <wout@impinc.co.uk>2013-01-22 17:54:28 +0100
committerwout <wout@impinc.co.uk>2013-01-22 17:54:28 +0100
commitb72373cf2fc024714825da95c59879ce9cbb4521 (patch)
tree1f3b260f9d2da54d1df7bca7b540bb15a0863e55 /src/sugar.js
parent6ae497706394d96b87e045afa8c7260790c4a7f1 (diff)
downloadsvg.js-b72373cf2fc024714825da95c59879ce9cbb4521.tar.gz
svg.js-b72373cf2fc024714825da95c59879ce9cbb4521.zip
Fix in offset for SVG.Wrap
Diffstat (limited to 'src/sugar.js')
-rw-r--r--src/sugar.js60
1 files changed, 25 insertions, 35 deletions
diff --git a/src/sugar.js b/src/sugar.js
index fef1363..b73be2e 100644
--- a/src/sugar.js
+++ b/src/sugar.js
@@ -29,23 +29,35 @@ var _colorPrefix = function(type, attr) {
});
-SVG.extend(SVG.Element, {
- // Rotation
- rotate: function(angle) {
- return this.transform({
- rotation: angle || 0
- });
- },
- // Skew
- skew: function(x, y) {
- return this.transform({
- skewX: x || 0,
- skewY: y || 0
+[SVG.Element, SVG.FX].forEach(function(module) {
+ if (module) {
+ SVG.extend(module, {
+ // Rotation
+ rotate: function(angle) {
+ return this.transform({
+ rotation: angle || 0
+ });
+ },
+ // Skew
+ skew: function(x, y) {
+ return this.transform({
+ skewX: x || 0,
+ skewY: y || 0
+ });
+ },
+ // Scale
+ scale: function(x, y) {
+ return this.transform({
+ scaleX: x || 0,
+ scaleY: y || 0
+ });
+ }
+
});
}
-
});
+
if (SVG.G) {
SVG.extend(SVG.G, {
// Move using translate
@@ -80,25 +92,3 @@ if (SVG.Text) {
});
}
-
-if (SVG.FX) {
- SVG.extend(SVG.FX, {
- // Rotation
- rotate: function(angle) {
- return this.transform({
- rotation: angle || 0
- });
- },
-
- // Skew
- skew: function(x, y) {
- return this.transform({
- skewX: x || 0,
- skewY: y || 0
- });
- }
-
- });
-}
-
-