Fixing unit tests.
This commit is contained in:
Vojtech Bubnik 2022-06-24 17:46:26 +02:00
parent d01f6099c3
commit c6bcaedba9

View File

@ -132,12 +132,17 @@ template void Polyline::simplify_by_visibility<ExPolygonCollection>(const ExPoly
void Polyline::split_at(const Point &point, Polyline* p1, Polyline* p2) const
{
if (this->size() < 2 || this->points.front() == point) {
if (this->size() < 2) {
*p1 = *this;
p2->clear();
return;
}
if (this->points.front() == point) {
*p1 = point;
*p2 = *this;
}
auto min_dist2 = std::numeric_limits<double>::max();
auto min_point_it = this->points.cbegin();
Point prev = this->points.front();