Fix removing last duplicate point.
If removeFirstAndLast not active the last point must remain intact.
This commit is contained in:
parent
56ae4a1381
commit
5fcefc0642
|
@ -246,14 +246,15 @@ QVector<T> VAbstractPiece::RemoveDublicates(const QVector<T> &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);
|
||||
}
|
||||
--i;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user