1
0
Fork 0

join matrix with commas, computed transformed point coords before mutating

This commit is contained in:
Enoch Riese 2023-04-14 15:43:26 -04:00
parent 29a0b08a1d
commit 5311a9ed28

View file

@ -746,7 +746,7 @@ export function combineTransforms(transforms = []) {
} }
// Return the combined matrix transform // 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 // Apply the matrix transform to the coordinates
point.x = point.x * matrix[0] + point.y * matrix[2] + matrix[4] const newX = point.x * matrix[0] + point.y * matrix[2] + matrix[4]
point.y = point.x * matrix[1] + point.y * matrix[3] + matrix[5] const newY = point.x * matrix[1] + point.y * matrix[3] + matrix[5]
point.x = newX
point.y = newY
return point return point
} }