-
Notifications
You must be signed in to change notification settings - Fork 420
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
Offset doesn't apply correctly when set with matrix #1250
Comments
This is because image scaling (where the transform is scaled up by the image size) is applied after the offset calculation (which is based on scale). Basically to bring this up to equivalence without API changes you could disable image scaling in the DrawParam and manually scale the scale values by the image size. In the API though it would probably be helpful if we exposed a parameter in |
Describe the bug
Same transform behaves differently depending on if it is set with individual values or as a matrix.
To Reproduce
Expected behavior
These two draw commands should draw the same thing because they are identical but they don't. When using the matrix form, the offset doesn't center the image. In order to get the same result, I have to set offset to (image.width/2, image.height/2).
I believe the issue is here in /graphics/draw.rs:
These 2 arms of the match don't produce the same result.
Screenshots or pasted code
Hardware and Software:
The text was updated successfully, but these errors were encountered: