Refactoring.

Merge "if" statement with the enclosing one.
develop
Roman Telezhynskyi 2024-05-02 10:36:26 +03:00
parent be1a8d15d0
commit e5295c0665
1 changed files with 9 additions and 11 deletions

View File

@ -1616,20 +1616,18 @@ auto VLayoutPiece::ContourPath(bool togetherWithNotches, bool showLayoutAllowanc
}
path.addPath(passmaksPath);
if (!d->m_seamAllowanceMirrorLine.isNull() && IsShowFullPiece())
if (!d->m_seamAllowanceMirrorLine.isNull() && IsShowFullPiece() &&
!VGObject::IsPointOnLineviaPDP(passmark.baseLine.p1(), d->m_seamAllowanceMirrorLine.p1(),
d->m_seamAllowanceMirrorLine.p2()))
{
if (!VGObject::IsPointOnLineviaPDP(passmark.baseLine.p1(), d->m_seamAllowanceMirrorLine.p1(),
d->m_seamAllowanceMirrorLine.p2()))
QPainterPath mirroredPassmaksPath;
for (const auto &line : passmark.lines)
{
QPainterPath mirroredPassmaksPath;
for (const auto &line : passmark.lines)
{
mirroredPassmaksPath.moveTo(line.p1());
mirroredPassmaksPath.lineTo(line.p2());
}
const QTransform matrix = VGObject::FlippingMatrix(d->m_seamAllowanceMirrorLine);
path.addPath(matrix.map(mirroredPassmaksPath));
mirroredPassmaksPath.moveTo(line.p1());
mirroredPassmaksPath.lineTo(line.p2());
}
const QTransform matrix = VGObject::FlippingMatrix(d->m_seamAllowanceMirrorLine);
path.addPath(matrix.map(mirroredPassmaksPath));
}
}
}