diff options
author | Erik Demaine <edemaine@mit.edu> | 2018-12-14 09:12:53 -0500 |
---|---|---|
committer | Erik Demaine <edemaine@mit.edu> | 2018-12-14 09:12:53 -0500 |
commit | 7a67de3aa992e8cf9b9110832f6ec2a55b378df7 (patch) | |
tree | c7ffa4eb3454add7f9415502a0032ac9b8f74185 | |
parent | 78e40cb0aa4a0e3a8ee024651fba0cbfc2494bee (diff) | |
download | svg.js-7a67de3aa992e8cf9b9110832f6ec2a55b378df7.tar.gz svg.js-7a67de3aa992e8cf9b9110832f6ec2a55b378df7.zip |
Bug fix
-rw-r--r-- | src/types/PointArray.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/types/PointArray.js b/src/types/PointArray.js index 4117233..53ac425 100644 --- a/src/types/PointArray.js +++ b/src/types/PointArray.js @@ -73,12 +73,14 @@ extend(PointArray, { // transform points with matrix (similar to Point.transform) transform (m) { - let points = [] + const points = [] for (let point of this) { // Perform the matrix multiplication - points.push([m.a * point.x + m.c * point.y + m.e, - m.b * point.x + m.d * point.y + m.f]) + points.push([ + m.a * point[0] + m.c * point[1] + m.e, + m.b * point[0] + m.d * point[1] + m.f + ]) } // Return the required point |