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 brush cursor size with canvas rotation #1869

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

scribblemaniac
Copy link
Member

When rotating the canvas, the brush cursor displays the wrong size. This was because mapRect is used, which will expand the size of a QRect to fit the bounding box of a rotated rectangle. This fix manually applies the view transform to the rect by translating the rect (based on the view translation, scale and rotation) and scaling the rect size without actually rotating the rect.

Fixes #1868.

@scribblemaniac scribblemaniac added Bug Canvas UI Related to the visual appearance of the program 🔹 Minor PR (only one reviewer required) labels Jul 26, 2024
@HeCorr
Copy link
Contributor

HeCorr commented Jul 26, 2024

This works perfectly, even when the view is flipped! Thank you so so much! 😄

Copy link
Member

@MrStevns MrStevns left a comment

Choose a reason for hiding this comment

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

Changes looks good to me.
Thanks for fixing this 👍

@MrStevns MrStevns merged commit e910aee into pencil2d:master Jul 27, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Canvas 🔹 Minor PR (only one reviewer required) UI Related to the visual appearance of the program
Projects
Development

Successfully merging this pull request may close these issues.

Canvas Cursor changes visual size when view is rotated
3 participants