From 5311a9ed28df62d72c84676fecf0f92b5c31bf94 Mon Sep 17 00:00:00 2001 From: Enoch Riese Date: Fri, 14 Apr 2023 15:43:26 -0400 Subject: [PATCH] join matrix with commas, computed transformed point coords before mutating --- packages/core/src/utils.mjs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/core/src/utils.mjs b/packages/core/src/utils.mjs index d2ead571933..700fc9518f3 100644 --- a/packages/core/src/utils.mjs +++ b/packages/core/src/utils.mjs @@ -746,7 +746,7 @@ export function combineTransforms(transforms = []) { } // Return the combined matrix transform - return 'matrix(' + matrix.join(' ') + ')' + return 'matrix(' + matrix.join(', ') + ')' } /** @@ -792,8 +792,11 @@ export function applyTransformToPoint(transform, point) { } // Apply the matrix transform to the coordinates - point.x = point.x * matrix[0] + point.y * matrix[2] + matrix[4] - point.y = point.x * matrix[1] + point.y * matrix[3] + matrix[5] + const newX = point.x * matrix[0] + point.y * matrix[2] + matrix[4] + const newY = point.x * matrix[1] + point.y * matrix[3] + matrix[5] + + point.x = newX + point.y = newY return point }