From 7a67de3aa992e8cf9b9110832f6ec2a55b378df7 Mon Sep 17 00:00:00 2001 From: Erik Demaine Date: Fri, 14 Dec 2018 09:12:53 -0500 Subject: Bug fix --- src/types/PointArray.js | 8 +++++--- 1 file 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 -- cgit v1.2.3