Skip to content

Commit

Permalink
Fix importing paths with rotate transforms with anchor coordinates.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodovich committed Nov 23, 2015
1 parent a25459c commit 17c4962
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 17c4962

Please sign in to comment.