From 17c4962e19211ef7dd6357ed1783a3f6e7bbaa2a Mon Sep 17 00:00:00 2001 From: Jim Rodovich Date: Mon, 23 Nov 2015 13:25:04 -0600 Subject: [PATCH] Fix importing paths with `rotate` transforms with anchor coordinates. --- src/parser.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/parser.js b/src/parser.js index 6b42c0630fb..adddcc5ecec 100644 --- a/src/parser.js +++ b/src/parser.js @@ -130,12 +130,16 @@ */ fabric.parseTransformAttribute = (function() { function rotateMatrix(matrix, args) { - var angle = args[0]; + var angle = args[0], + x = (args.length === 3) ? args[1] : 0, + y = (args.length === 3) ? args[2] : 0; matrix[0] = Math.cos(angle); matrix[1] = Math.sin(angle); matrix[2] = -Math.sin(angle); matrix[3] = Math.cos(angle); + matrix[4] = x - (matrix[0] * x + matrix[2] * y); + matrix[5] = y - (matrix[1] * x + matrix[3] * y); } function scaleMatrix(matrix, args) {