From 2fc24914841b5fc47e05f6f21f122e9d78e3ee59 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 11 Nov 2016 17:58:13 +0200 Subject: [PATCH] Set local seam allowance when building an equdistant. --HG-- branch : feature --- src/libs/vlayout/vabstractpiece.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/libs/vlayout/vabstractpiece.cpp b/src/libs/vlayout/vabstractpiece.cpp index c0d052653..8623f4ffa 100644 --- a/src/libs/vlayout/vabstractpiece.cpp +++ b/src/libs/vlayout/vabstractpiece.cpp @@ -420,8 +420,20 @@ QVector VAbstractPiece::EkvPoint(const VSAPoint &p1Line1, const VSAPoin //--------------------------------------------------------------------------------------------------------------------- QLineF VAbstractPiece::ParallelLine(const VSAPoint &p1, const VSAPoint &p2, qreal width) { - const QLineF paralel = QLineF(SingleParallelPoint(p1, p2, 90, width), - SingleParallelPoint(p2, p1, -90, width)); + qreal w1 = p1.GetSAAfter(); + if (w1 < 0) + { + w1 = width; + } + + qreal w2 = p2.GetSABefore(); + if (w2 < 0) + { + w2 = width; + } + + const QLineF paralel = QLineF(SingleParallelPoint(p1, p2, 90, w1), + SingleParallelPoint(p2, p1, -90, w2)); return paralel; }