Skip to content
Commit b8c33501 authored by Maciej Jesionowski's avatar Maciej Jesionowski Committed by Dmitry Kazakov
Browse files

Fix the canvas rotation drift

This patch changes how the canvas rotation is calculated.
Previously the rotation was applied continuously, updating the canvas
transformation with very small angle increments, which led to numerical
error accumulating throughout the operation.

The new method is modal. When canvas rotation action begins, the current
transformation is saved and used as the base, while the user adjusts the
angle. Once the action ends, the final transformation is applied in one
go.

**EDIT 3/27/2023:** With the last update I verified on an Android tablet with Rotate Mode touch events (rotate without zoom) and it's working correctly.

BUG: 409894

Test Plan
---------

Just create a new document and rotate canvas through various means. The fix is specifically for fine-grained rotation (SHIFT+SPACE drag). I tested on Windows and checked interactions of various rotation methods (discrete, and with the controls on the status bar).

This forum post shows the before and after behavior: [LINK](https://krita-artists.org/t/bug-rotate-canvas-drift/40832/7)

Formalities Checklist
--------------------- 

- [x] I confirmed this builds.
- [x] I confirmed Krita ran and the relevant functions work (on Windows).
- [ ] I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!) Canvas rotate test is marked as broken.
- [x] I made sure my commits build individually and have good descriptions as per [KDE guidelines](https://community.kde.org/Policies/Commit_Policy).
- [x] I made sure my code conforms to the standards set in the HACKING file.
- [x] I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per [KDE Licensing Policy](https://community.kde.org/Policies/Licensing_Policy).

_**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.**_
parent fc549a93
Pipeline #366998 failed with stage
in 7 minutes and 19 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment