From d7041cc835664a61ca001226e69dec3d15e8009b Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 20 May 2021 11:48:47 +0300 Subject: [PATCH] Control length of a passmark for builtin seam allowance with global setting. #124 This case was not covered. (cherry picked from commit a5191ce7636a6320567a26c86c5004d450f0bc8c) --- src/libs/vpatterndb/vpassmark.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/libs/vpatterndb/vpassmark.cpp b/src/libs/vpatterndb/vpassmark.cpp index f7135acde..84d4ab4e0 100644 --- a/src/libs/vpatterndb/vpassmark.cpp +++ b/src/libs/vpatterndb/vpassmark.cpp @@ -831,12 +831,20 @@ QVector VPassmark::BuiltInSAPassmarkBaseLine(const VPiece &piece) const } else { - const QString errorMsg = QObject::tr("Cannot calculate a notch for point '%1' in piece '%2' with built in " - "seam allowance. User must manually provide length.") - .arg(m_data.nodeName, m_data.pieceName); - VAbstractApplication::VApp()->IsPedantic() ? throw VExceptionInvalidNotch(errorMsg) : - qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; - return QVector(); + if (m_data.globalPassmarkLength > accuracyPointOnLine) + { + length = m_data.globalPassmarkLength; + } + else + { + const QString errorMsg = QObject::tr("Cannot calculate a notch for point '%1' in piece '%2' with built " + "in seam allowance. User must manually provide length.") + .arg(m_data.nodeName, m_data.pieceName); + VAbstractApplication::VApp()->IsPedantic() + ? throw VExceptionInvalidNotch(errorMsg) + : qWarning() << VAbstractValApplication::warningMessageSignature + errorMsg; + return {}; + } } }