From 30b433264fd4ed51d7a2db56c6f291652b9ca01a Mon Sep 17 00:00:00 2001 From: Ulrich-Matthias Schäfer Date: Tue, 15 Sep 2015 23:22:03 +0200 Subject: added transform to pattern and gradient (fix #383) added skewX and skewY --- src/matrix.js | 8 ++++++++ src/transform.js | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/matrix.js b/src/matrix.js index c715a8c..0773910 100644 --- a/src/matrix.js +++ b/src/matrix.js @@ -129,6 +129,14 @@ SVG.Matrix = SVG.invent({ , skew: function(x, y, cx, cy) { return this.around(cx, cy, this.native().skewX(x || 0).skewY(y || 0)) } + // SkewX + , skewX: function(x, cx, cy) { + return this.around(cx, cy, this.native().skewX(x || 0)) + } + // SkewY + , skewY: function(y, cx, cy) { + return this.around(cx, cy, this.native().skewY(y || 0)) + } // Transform around a center point , around: function(cx, cy, matrix) { return this diff --git a/src/transform.js b/src/transform.js index c1afd73..d4e450f 100644 --- a/src/transform.js +++ b/src/transform.js @@ -114,7 +114,7 @@ SVG.extend(SVG.Element, SVG.FX, { } } - return this.attr('transform', matrix) + return this.attr(this instanceof SVG.Pattern ? 'patternTransform' : this instanceof SVG.Gradient ? 'gradientTransform' : 'transform', matrix) } }) -- cgit v1.2.3