Fix zoom being too fast when zoomed in
Before this commit, it wasn't possible to create a rectangle with a good control over what's going on when you were very zoomed in (enough to see pixels) on a big canvas (like 2000 x 2000, zoom > 4000). The speed of canvas running off was too quick to make a controlled action. This commit scales the speed of the movement by the zoom, so the speed of the canvas is the same visually when zoomed in or zoomed out.
Test Plan
- Create a 2000x2000 document. For example: transform_tool_scaled_grid_example.kra
- Zoom in on the top left corner, where you see a bit of a grid. The zoom needs to be > 4000%.
- Try to create a small rectangle, let's say 6x6 pixels. Repeat it a few times just to be sure.
- If you can do it without the canvas running off, that's good. Before this MR, it would be very difficult.
- Make sure other zoom levels work just as well, too.
Formalities Checklist
- I confirmed this builds.
- I confirmed Krita ran and the relevant functions work.
- I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
- I made sure my commits build individually and have good descriptions as per KDE guidelines.
- I made sure my code conforms to the standards set in the HACKING file.
- I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
- Does the patch add a user-visible feature? If yes, is there a documentation MR ready for it at Krita Documentation Repository?
Reminder: the reviewer is responsible for merging the patch, this is to ensure at the least two people can build the patch. In case a patch breaks the build, both the author and the reviewer should be contacted to fix the build. If this is not possible, the commits shall be reverted, and a notification with the reasoning and any relevant logs shall be sent to the mailing list, kimageshop@kde.org.