-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 TransformOrigin for brushes #15037
Fix TransformOrigin for brushes #15037
Conversation
You can test this PR using the following package version. |
var transformOrigin = content.TransformOrigin.ToPixels(targetRect); | ||
var offset = Matrix.CreateTranslation(transformOrigin); | ||
|
||
transform *= -offset * content.Transform.Value * offset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work? I think -offset
also flips X and Y coordinates, but the test images won't catch this because they are symmetric in X and Y.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TransformOrigin mainly used to move the origin to some rotation point
The math is correct here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, only noticed now that -offset
actually means the inverse of offset
. I think it would be more efficient to CreateTranslation(-transformOrigin)
, but performance is probably not a problem here.
This reverts commit 4f8f46c.
What does the pull request do?
What is the current behavior?
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
Obsoletions / Deprecations
Fixed issues