Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Prevent rotation notice jitter around zero

Carsten Hartenfels4b930dfe3126
diff --git a/libs/ui/canvas/kis_canvas_controller.cpp b/libs/ui/canvas/kis_canvas_controller.cpp
index 6e340456a6..e563a90a34 100644
--- a/libs/ui/canvas/kis_canvas_controller.cpp
+++ b/libs/ui/canvas/kis_canvas_controller.cpp
@@ -269,6 +269,10 @@ void KisCanvasController::mirrorCanvasAroundCanvas(bool enable)
void KisCanvasController::Private::showRotationValueOnCanvas()
{
qreal rotationAngle = coordinatesConverter->rotationAngle();
+ // Prevent the displayed rotation angle from jittering between -0.0 and 0.0.
+ if (rotationAngle > -0.05 && rotationAngle < 0.05) {
+ rotationAngle = 0.0;
+ }
view->viewManager()->
showFloatingMessage(
i18nc("floating message about rotation", "Rotation: %1° ",