mirror of
git://projects.qi-hardware.com/cae-tools.git
synced 2025-01-09 01:40:15 +02:00
poly2d/f2d_tri_holes.cpp (find_point): don't loop forever on closed polygons
This commit is contained in:
parent
d758359791
commit
d0b5696a07
@ -169,11 +169,15 @@ void insert_polygon(CDT &cdt, const Polygon_2 &polygon)
|
|||||||
|
|
||||||
static const struct v2d *find_point(const struct p2d *p, double x, double y)
|
static const struct v2d *find_point(const struct p2d *p, double x, double y)
|
||||||
{
|
{
|
||||||
const struct v2d *v;
|
const struct v2d *v = p->v;
|
||||||
|
|
||||||
for (v = p->v; v; v = v->next)
|
while (v) {
|
||||||
if (v->x == x && v->y == y)
|
if (v->x == x && v->y == y)
|
||||||
break;
|
break;
|
||||||
|
v = v->next;
|
||||||
|
if (v == p->v)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
return v;
|
return v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user