Bug 434993

Summary: Angle selector widget in status bar incorrectly denotes 180 degrees at certain ranges of rotation
Product: [Applications] krita Reporter: tomtomtomreportingin
Component: GeneralAssignee: Deif Lou <ginoba>
Status: RESOLVED FIXED    
Severity: minor CC: ginoba
Priority: NOR    
Version: 4.4.3   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:

Description tomtomtomreportingin 2021-03-26 21:16:09 UTC
SUMMARY
When rotating the canvas through other means besides the angle selector widget in the status bar, the spinbox starts incorrectly indicating an angle of about 180 degrees when rotating into a certain range. This occurs both with canvas input shortcuts and with the View -> Canvas -> Rotate actions.

STEPS TO REPRODUCE
1. Using canvas input shortcuts, rotate the canvas clockwise towards 180 degrees.

OBSERVED RESULT
* If using discrete steps, rotating clockwise past 180 degrees will make the spinbox continue to denote 180 degrees until 0 degrees is reached. Similar behavior happens in the inverse when rotating counterclockwise.
* If using smoothed canvas input rotation, the spinbox will "snap" to an 180 degree angle while rotating towards and out of it.

In both cases, there is no functional impact. The widget's spinbox merely displays the wrong angle.

EXPECTED RESULT
The correct angle should be displayed in the spinbox.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian sid
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.12.9 (Appimage)  

ADDITIONAL INFORMATION
Since this angle indicator was not displayed in the status bar in previous versions, it is technically not a regression.
Comment 1 Deif Lou 2021-03-26 22:53:59 UTC
Just for the record, this bug is also present in the overview docker and was kind of present before the angle widget was introduced. I copied some code from the overview docker angle handling, which uses the range [-180, 180]. The problem is that the range of the canvas rotation is [-360, 360] so there is a mismatch between the acual angle an the angle shown in the slider (now angle selector) in the overview docker. This behavior got propagated to the angle selector in the status bar, as I copied the code from the overview docker.
The solution is to change the ranges of the angle selectors both in the status bar and the overview docker.
Comment 2 Deif Lou 2021-03-26 23:31:42 UTC
Git commit 3404cb6698c46488ae70ca55a1c4838aac276bec by Deif Lou.
Committed on 26/03/2021 at 23:30.
Pushed by deiflou into branch 'master'.

Fix angle range in the angle selector in status bar and overview docker

M  +1    -1    libs/ui/kis_statusbar.cc
M  +2    -8    plugins/dockers/overview/overviewdocker_dock.cpp

https://invent.kde.org/graphics/krita/commit/3404cb6698c46488ae70ca55a1c4838aac276bec
Comment 3 Deif Lou 2021-03-26 23:32:46 UTC
Git commit 66822cda7311881678a95748e0d363de8c47ee88 by Deif Lou.
Committed on 26/03/2021 at 23:28.
Pushed by deiflou into branch 'krita/4.3'.

Fix angle range in the angle selector in status bar and overview docker

(cherry picked from commit 60047275c25495d50bebfd3e77a8516ed6a9f619)

M  +1    -1    libs/ui/kis_statusbar.cc
M  +2    -8    plugins/dockers/overview/overviewdocker_dock.cpp

https://invent.kde.org/graphics/krita/commit/66822cda7311881678a95748e0d363de8c47ee88