diff --git a/src/libs/vlayout/vabstractpiece.h b/src/libs/vlayout/vabstractpiece.h index 177efa4bd..d212db645 100644 --- a/src/libs/vlayout/vabstractpiece.h +++ b/src/libs/vlayout/vabstractpiece.h @@ -246,14 +246,15 @@ QVector VAbstractPiece::RemoveDublicates(const QVector &points, bool remov { if (VFuzzyComparePoints(p.at(i), p.at(i+1))) { - if (not removeFirstAndLast && (i == p.size()-1)) + if (not removeFirstAndLast && (i == p.size()-2)) { - continue; + p.erase(p.begin() + i); + } + else + { + p.erase(p.begin() + i + 1); } - - p.erase(p.begin() + i + 1); --i; - continue; } }