The method 'setRotation' in libkis/Canvas.cpp is either mislabeled or incomplete. It rotates the canvas by the amount of the given angle instead of setting the canvas' rotation to that angle. This seems to be because 'setRotation' passes its unaltered argument on to a different method called 'rotateCanvas' without making adjustments. The fix is to subtract the canvas' current rotation from the value of the argument before passing it on to 'rotateCanvas'. Or you could rename the function and adjust the documentation :P (I would submit a MR with a fix, but I don't have an environment set up to check if what I submit is valid C++ code)
Thanks for the report. I've implemented and pushed your fix.
Git commit 5631090c79833acdece0a7cc18712536b98eac13 by Boudewijn Rempt. Committed on 14/01/2020 at 13:11. Pushed by rempt into branch 'master'. Fix the Canvas::setRotation method M +1 -1 libs/libkis/Canvas.cpp https://invent.kde.org/kde/krita/commit/5631090c79833acdece0a7cc18712536b98eac13
Git commit cdce9eb7a4f2bac227f00d8e26253b46cddc242a by Boudewijn Rempt. Committed on 28/01/2020 at 09:09. Pushed by rempt into branch 'krita/4.2'. Fix the Canvas::setRotation method (cherry picked from commit 5631090c79833acdece0a7cc18712536b98eac13) M +1 -1 libs/libkis/Canvas.cpp https://invent.kde.org/kde/krita/commit/cdce9eb7a4f2bac227f00d8e26253b46cddc242a