From e5295c0665780db3b76ecfc74b868029b05fd55b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 2 May 2024 10:36:26 +0300 Subject: [PATCH] Refactoring. Merge "if" statement with the enclosing one. --- src/libs/vlayout/vlayoutpiece.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/libs/vlayout/vlayoutpiece.cpp b/src/libs/vlayout/vlayoutpiece.cpp index a01c13889..7a00c9560 100644 --- a/src/libs/vlayout/vlayoutpiece.cpp +++ b/src/libs/vlayout/vlayoutpiece.cpp @@ -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)); } } }