Review fixes for 11.4 and 11.4b
ubuntu.sh takes Ubuntu 24.04 and its derivatives alone, since the DEB names 24.04's t64 libraries. nixos.sh installs the newest release's tag, not main. The release workflow refuses a tag that names another version than the build files, and runs on the Node 24 actions. DistortTests pins Swift's division by w past the horizon. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
c864304695
commit
d0088fac89
9 files changed
+81
-29
No files matched your search
@@ -45,6 +45,7 @@ private slots:
|
||||
void carriedCornersAndWarpedMasks();
|
||||
void nudgesGroupsAndRefusals();
|
||||
void mapPathCarriesCurvesFlipsAndTheFillRule();
|
||||
void pointsPastTheHorizonDivideAsSwiftDoes();
|
||||
};
|
||||
|
||||
void DistortTests::cornersRunClockwiseFromTheTopLeft()
|
||||
@@ -349,5 +350,28 @@ void DistortTests::mapPathCarriesCurvesFlipsAndTheFillRule()
|
||||
QVERIFY(!DistortWarp::mapPath(ellipse, placement, QSizeF(0, 10), transform, box).has_value());
|
||||
}
|
||||
|
||||
// Past the horizon Swift divides by w; Qt 6.10 clamps.
|
||||
void DistortTests::pointsPastTheHorizonDivideAsSwiftDoes()
|
||||
{
|
||||
const Corners trapezoid = {QPointF(0, 0), QPointF(40, 0), QPointF(30, 20), QPointF(10, 20)};
|
||||
const QTransform map = DistortWarp::homography(trapezoid);
|
||||
const auto divided = [&map](QPointF p) {
|
||||
const double w = map.m13() * p.x() + map.m23() * p.y() + map.m33();
|
||||
return QPointF((map.m11() * p.x() + map.m21() * p.y() + map.m31()) / w, (map.m12() * p.x() + map.m22() * p.y() + map.m32()) / w);
|
||||
};
|
||||
const LayerTransform unit{.origin = {0, 0}, .size = {1, 1}};
|
||||
const Corners far = DistortWarp::corners({.origin = {0, -3}, .size = {1, 1}});
|
||||
for (const QPointF corner : far)
|
||||
QVERIFY(map.m13() * corner.x() + map.m23() * corner.y() + map.m33() < 0);
|
||||
const Corners carried = DistortWarp::carried({.origin = {0, -3}, .size = {1, 1}}, unit, trapezoid);
|
||||
for (size_t index = 0; index < 4; ++index)
|
||||
QVERIFY(near(carried[index], divided(far[index])));
|
||||
QPainterPath line;
|
||||
line.moveTo(far[0]);
|
||||
line.lineTo(far[2]);
|
||||
const QPainterPath mapped = DistortWarp::mapPath(line, QTransform(), QSizeF(1, 1), unit, trapezoid).value();
|
||||
QVERIFY(near(mapped.elementAt(0), divided(far[0])) && near(mapped.elementAt(1), divided(far[2])));
|
||||
}
|
||||
|
||||
QTEST_GUILESS_MAIN(DistortTests)
|
||||
#include "DistortTests.moc"
|
||||
Reference in new issue
Block a user