pencil2d / pencil

Pencil2D is an easy, intuitive tool to make 2D hand-drawn animations. Pencil2D is open source and cross-platform.
http://pencil2d.org
GNU General Public License v2.0
1.45k stars 272 forks source link

Fix brush cursor size with canvas rotation #1869

Closed scribblemaniac closed 2 months ago

scribblemaniac commented 2 months ago

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.

HeCorr commented 2 months ago

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