From a087e9ea74c56616332468563aea989888ce4673 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Wed, 19 Dec 2018 09:19:37 +0200 Subject: [PATCH] Fixed issue #909. Valentina produces wrong united path. --HG-- branch : release --- ChangeLog.txt | 1 + src/libs/vpatterndb/vpiece.cpp | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 494bd6bc9..1e4e2c312 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,6 +1,7 @@ # Version 0.6.2 (unreleased) - [#903] Bug in tool Cut Spline path. - [#905] Valentina crashes with error: This id is not unique. +- [#909] Valentina produces wrong united path. # Version 0.6.1 October 23, 2018 - [#885] Regression. Broken support for multi size measurements. diff --git a/src/libs/vpatterndb/vpiece.cpp b/src/libs/vpatterndb/vpiece.cpp index fb08f8578..9038fa05e 100644 --- a/src/libs/vpatterndb/vpiece.cpp +++ b/src/libs/vpatterndb/vpiece.cpp @@ -928,8 +928,17 @@ QVector VPiece::GetUnitedPath(const VContainer *data) const continue; } - const QVector midBefore = united.mid(0, indexStartPoint+1); - const QVector midAfter = united.mid(indexEndPoint, united.size() - midBefore.size()); + QVector midBefore; + QVector midAfter; + if (indexStartPoint <= indexEndPoint) + { + midBefore = united.mid(0, indexStartPoint+1); + midAfter = united.mid(indexEndPoint, united.size() - midBefore.size()); + } + else + { + midBefore = united.mid(indexEndPoint, indexStartPoint+1); + } QVector customNodes = data->GetPiecePath(records.at(i).path).GetNodes(); if (records.at(i).reverse)