Commit dc153005 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Fix descrete rotation to be aligned to absolute position, not relative

That was a regression from 63bef1e4

BUG:410554
parent 5d8d3d65
......@@ -124,7 +124,15 @@ void KisRotateCanvasAction::cursorMovedAbsolute(const QPointF &startPos, const Q
if (d->mode == DiscreteRotateModeShortcut) {
const qreal angleStep = 15;
newRotation = qRound(newRotation / angleStep) * angleStep;
// avoid jumps at the beginning of the rotation action
if (qAbs(newRotation) > 0.5 * angleStep) {
const qreal currentCanvasRotation = converter->rotationAngle();
const qreal desiredOffset = newRotation - d->previousRotation;
newRotation = qRound((currentCanvasRotation + desiredOffset) / angleStep) * angleStep - currentCanvasRotation + d->previousRotation;
} else {
newRotation = d->previousRotation;
}
}
KisCanvasController *canvasController =
......
Markdown is supported
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