14.4 round 2: an open edit closes before the turn, tested

This commit is contained in:
ZacharyZhang-NY committed 2026-10-11 04:16:11 -04:00
1 parent f883f10777
commit 3eaf54f935
2 files changed
+26 -1

No files matched your search

+25
View File
@@ -44,6 +44,7 @@ private slots:
void turnedLayersAndPlacedMasksTurnAlong();
void itIsOneStepRefusedWhereLayersCannotChange();
void everyLayerAndEveryPlacedMaskTurns();
void anOpenEditClosesBeforeTheTurn();
};
void CanvasRotationTests::clockwiseTurnsThePixelsExactly()
@@ -220,5 +221,29 @@ void CanvasRotationTests::everyLayerAndEveryPlacedMaskTurns()
QVERIFY(session.document().value().layers == placed);
}
void CanvasRotationTests::anOpenEditClosesBeforeTheTurn()
{
EditorSession session;
canvas(session);
// An opacity drag is its own step, closed first.
session.beginOpacityEdit();
session.setLayerOpacity(0.25);
session.rotateCanvas(true);
QCOMPARE(session.history.undoName(), QString("Rotate Canvas 90° Clockwise"));
session.undo();
QCOMPARE(session.document().value().size(), QSizeF(3, 2));
QCOMPARE(session.activeLayer().value().opacity, 0.25);
session.undo();
QCOMPARE(session.activeLayer().value().opacity, 1.0);
// A pending transform lands first, its own step.
session.beginTransform();
session.nudgeLayer(1, 0);
session.rotateCanvas(true);
QVERIFY(!session.transformEdit());
session.undo();
QCOMPARE(session.document().value().size(), QSizeF(3, 2));
QCOMPARE(session.activeLayer().value().origin(), QPointF(1, 0));
}
QTEST_GUILESS_MAIN(CanvasRotationTests)
#include "CanvasRotationTests.moc"