Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix importing paths with rotate transforms with anchor coordinates. #2645

Merged
merged 1 commit into from
Dec 3, 2015
Merged

Fix importing paths with rotate transforms with anchor coordinates. #2645

merged 1 commit into from
Dec 3, 2015

Conversation

rodovich
Copy link
Contributor

This adds support for the rotate(angle, x, y) syntax for rotating around a given point
(http://www.w3.org/TR/SVG/coords.html#TransformAttribute). Tested by the fixture in fabricjs/fabricjs.com#101.

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

   matrix[0] = Math.cos(angle);
   matrix[1] = Math.sin(angle);
   matrix[2] = -matrix[1];
   matrix[3] = matrix[0];

non sense optimization?

kangax added a commit that referenced this pull request Dec 3, 2015
Fix importing paths with `rotate` transforms with anchor coordinates.
@kangax kangax merged commit 35668b5 into fabricjs:master Dec 3, 2015
@rodovich rodovich deleted the rotate-anchor branch December 4, 2015 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants