Closed HeCorr closed 3 months ago
After some quick debugging it seems that updateRect
ends up having a size of 72x72 when the view is at 45° and 50x50 (the brush width) at 0° and 100% zoom.
Unfortunately I'm not very familiar with that part of the code so I don't think I can fix this one.
scribblemaniac looked into this and it seems the issue is caused by this call to viewTransform.mapRect()
in CanvasCursorPainter::preparePainter()
:
When you map a rect with a transform that contains a rotation, it will return the minimum bounding box that contains the rotated rectangle, which is larger than the original rectangle. Here's the first result in an image search that demonstrates what's happening. If the red rectangle is the original bounds of the brush cursor when rotated, the black rectangle is the result of mapRect:
Issue Summary
When the canvas is rotated, the Canvas Cursor (the circle) of drawing tools appears to be larger than it should be, peaking at 45° increments (45°, 135°, 225°, 315°).
The actual drawing width is not affected.
### Expected Results I expected the Canvas Cursor to stay the same size at any rotation angle. ### Video or Image Reference https://github.com/user-attachments/assets/b90664d3-8418-46ca-9275-728923659d7f ### Steps to reproduce 1. Launch Pencil2D 2. Select the Brush tool 3. Set it's Width to 50 and Feather to 1 4. Rest your cursor over the canvas 5. Press the `Rotate Clockwise` shortcut key repeatedly ### System Information + Pencil2D Version: `Nightly Build Jun 17 2024` + Operating System: `Windows 10` + RAM Size: `64 GB`