Bug 472839

Summary: Discrete Canvas Rotation no longer snaps resulting angle to 15deg increments
Product: [Applications] krita Reporter: ZeroFrost <zerofrost.pl>
Component: GeneralAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: alvin
Priority: NOR Keywords: regression
Version: git master (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description ZeroFrost 2023-07-31 12:15:31 UTC
SUMMARY
***
Rotate Canvas Shift + Alt + Space doesnt snap to 15Degree increments After being rotated By Shift + Space by random degree. Which prefents zeroing rotation.
This bug was present and fixed before. Worked well in 5.1.
***


STEPS TO REPRODUCE
1. use Shift + Space to ratete canvas by random degree
2. use Shift + Alt + Space to rotate canvas by 15degree increments


OBSERVED RESULT
random degree doesnt reset. Shift + Alt + Space just adds +15degrees to whatever rotation canvas was

EXPECTED RESULT
In previous versions Shift + Alt + Space always snapped to (...) -30 -15 0 15 30 (...) allowing to reset rotation to 0

SOFTWARE/OS VERSIONS
Krita 5.2.0-beta1
Comment 2 Bug Janitor Service 2023-08-02 00:28:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1880
Comment 3 Alvin Wong 2023-08-02 10:24:43 UTC
Git commit d378f1b64cdeca767e616c896c5626864013f94a by Alvin Wong, on behalf of Maciej Jesionowski.
Committed on 02/08/2023 at 12:24.
Pushed by alvinwong into branch 'master'.

Snap to exact 15 degree increments when using discrete rotate

I missed this behavior when working on !1779. Currently the discrete rotation will simply add a 15 degree increment to the canvas rotation. Instead, it should first snap to the nearest multiple of 15 degrees.

I have verified the behavior on Windows 11.

If accepted, this should be cherry-picked to `krita/5.2` please.

M  +14   -6    libs/ui/input/kis_rotate_canvas_action.cpp

https://invent.kde.org/graphics/krita/-/commit/d378f1b64cdeca767e616c896c5626864013f94a
Comment 4 Alvin Wong 2023-08-02 10:29:32 UTC
Git commit 64af6556f0644bbc6da06933f3b4aaeeb0d2fd66 by Alvin Wong, on behalf of Maciej Jesionowski.
Committed on 02/08/2023 at 12:26.
Pushed by alvinwong into branch 'krita/5.2'.

Snap to exact 15 degree increments when using discrete rotate

I missed this behavior when working on !1779. Currently the discrete rotation will simply add a 15 degree increment to the canvas rotation. Instead, it should first snap to the nearest multiple of 15 degrees.

I have verified the behavior on Windows 11.

If accepted, this should be cherry-picked to `krita/5.2` please.
(cherry picked from commit d378f1b64cdeca767e616c896c5626864013f94a)

M  +14   -6    libs/ui/input/kis_rotate_canvas_action.cpp

https://invent.kde.org/graphics/krita/-/commit/64af6556f0644bbc6da06933f3b4aaeeb0d2fd66