summaryrefslogtreecommitdiffstats
path: root/src/matrix.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/matrix.js')
-rw-r--r--src/matrix.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/matrix.js b/src/matrix.js
index 0d72fea..6947e7e 100644
--- a/src/matrix.js
+++ b/src/matrix.js
@@ -75,7 +75,7 @@ SVG.Matrix = SVG.invent({
},
// Applies a matrix defined by its affine parameters
- compose: function (o) {
+ compose: function (o, ox, oy) {
// Get the parameters
var sx = o.scaleX || 1
var sy = o.scaleY || 1
@@ -217,10 +217,13 @@ SVG.Matrix = SVG.invent({
// Translate matrix
translate: function (x, y) {
- var translation = new SVG.Matrix(this)
- translation.e += x || 0
- translation.f += y || 0
- return translation
+ return new SVG.Matrix(this).translateO(x, y)
+ },
+
+ translateO: function (x, y) {
+ this.e += x || 0
+ this.f += y || 0
+ return this
},
// Scale matrix