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

suggestion: removing translate just before ctx.restore() #31

Open
Dierk opened this issue May 8, 2019 · 1 comment
Open

suggestion: removing translate just before ctx.restore() #31

Dierk opened this issue May 8, 2019 · 1 comment

Comments

@Dierk
Copy link

Dierk commented May 8, 2019

There is a number of places where a translate() is called just before ctx.restore(), e.g. at

ctx.translate(-centerX, -centerY);
ctx.restore();

but since translation goes into the transformation matrix and this is part of the save()-ed state and thus restore()-ed it should be possible to remove the translate() call.

@mcrossley
Copy link
Collaborator

Yes, those translates are superfluous and can be removed.

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

No branches or pull requests

2 participants