summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/matrix.js7
-rw-r--r--src/sugar.js3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/matrix.js b/src/matrix.js
index 356b790..c040b7a 100644
--- a/src/matrix.js
+++ b/src/matrix.js
@@ -115,7 +115,12 @@ SVG.Matrix = SVG.invent({
}
// Flip matrix on x or y, at a given offset
, flip: function(a, o) {
- return a == 'x' ? this.scale(-1, 1, o, 0) : this.scale(1, -1, 0, o)
+ o = typeof a == 'number' ? a : o
+ return a == 'x' ?
+ this.scale(-1, 1, o, 0) :
+ a == 'y' ?
+ this.scale(1, -1, 0, o) :
+ this.scale(-1, -1, o, o)
}
// Skew
, skew: function(x, y, cx, cy) {
diff --git a/src/sugar.js b/src/sugar.js
index e5bea4e..098c892 100644
--- a/src/sugar.js
+++ b/src/sugar.js
@@ -53,7 +53,8 @@ SVG.extend(SVG.Element, SVG.FX, {
}
// Map flip to transform
, flip: function(a, o) {
- return this.transform({ flip: a, offset: o })
+ o = typeof a == 'number' ? a : o
+ return this.transform({ flip: a || 'both', offset: o })
}
// Map matrix to transform
, matrix: function(m) {