Merge branch 'port-d'
# Conflicts: # AGENTS.md
This commit is contained in:
commit
8204e6a28b
14 files changed
+231
-101
No files matched your search
@@ -17,6 +17,7 @@ private slots:
|
||||
void liquifyStaysSharp();
|
||||
void liquifyDrawsFromTheUntouchedLayer();
|
||||
void smudgeLeavesOneFadingTrail();
|
||||
void aCommitKeepsATwentiethAndTheLastPoint();
|
||||
};
|
||||
|
||||
// Pushed across and back, the layer ends nearly unchanged.
|
||||
@@ -94,5 +95,23 @@ void WarpStrokeTests::smudgeLeavesOneFadingTrail()
|
||||
QVERIFY2(row.front() > row.back() + 20, qPrintable(QString("%1 to %2").arg(row.front()).arg(row.back())));
|
||||
}
|
||||
|
||||
// Swift's thinning: a twentieth of the brush apart, last kept.
|
||||
void WarpStrokeTests::aCommitKeepsATwentiethAndTheLastPoint()
|
||||
{
|
||||
QImage image = BrushRaster::context(80, 20, false);
|
||||
image.fill(Qt::red);
|
||||
WarpStroke stroke = warp(image, BlurToolMode::liquify, brush(100, 0.5, 0, 0, 0, 1));
|
||||
stroke.append(QPointF(0, 10));
|
||||
stroke.append(QPointF(51, 10));
|
||||
QCOMPARE(int(stroke.points().size()), 21);
|
||||
const std::vector<QPointF> kept = stroke.committedPoints();
|
||||
QCOMPARE(int(kept.size()), 8);
|
||||
QCOMPARE(kept.front(), stroke.points().front());
|
||||
QCOMPARE(kept[1], stroke.points()[3]);
|
||||
QCOMPARE(kept[6], stroke.points()[18]);
|
||||
// Two and a half from the previous, kept as last.
|
||||
QCOMPARE(kept.back(), QPointF(51, 10));
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(WarpStrokeTests)
|
||||
#include "WarpStrokeTests.moc"
|
||||
Reference in new issue
Block a user