Fix Check notch opening.

This commit is contained in:
Roman Telezhynskyi 2023-05-10 18:07:58 +03:00
parent 394df3c775
commit 608b90122c

View File

@ -531,7 +531,7 @@ auto CreateCheckMarkPassmark(const VPiecePassmarkData &passmarkData, const QLine
const QVector<QPointF> &seamAllowance) -> QVector<QLineF>
{
constexpr qreal defAngle = 45;
qreal defWidth = line.length() * qTan(qDegreesToRadians(defAngle));
qreal defWidth = qAbs(line.length() * qTan(qDegreesToRadians(defAngle)));
if (not passmarkData.passmarkSAPoint.IsPassmarkClockwiseOpening())
{
@ -544,14 +544,14 @@ auto CreateCheckMarkPassmark(const VPiecePassmarkData &passmarkData, const QLine
if (width > 0)
{ // clockwise
QLineF l1(line.p2(), line.p1());
l1.setAngle(l1.angle() + angle);
l1.setAngle(l1.angle() - angle);
l1 = VPassmark::FindIntersection(l1, seamAllowance);
return {{l1.p2(), l1.p1()}, {line.p2(), line.p1()}};
}
QLineF l2(line.p2(), line.p1());
l2.setAngle(l2.angle() - angle);
l2.setAngle(l2.angle() + angle);
l2 = VPassmark::FindIntersection(l2, seamAllowance);
return {line, l2};