1
0
mirror of git://projects.qi-hardware.com/cae-tools.git synced 2024-12-22 23:16:27 +02:00

poly2d/p2d_attrib.c (p2d_no_intersect): don't test last vs. first segment

This one case slipped through. Surprisingly, it rarely produced a
complaint.
This commit is contained in:
Werner Almesberger 2015-01-18 09:09:43 -03:00
parent f94fb2f74a
commit 84f9d3c3b4

View File

@ -4,8 +4,7 @@
* Written 2012, 2015 by Werner Almesberger * Written 2012, 2015 by Werner Almesberger
* Copyright 2012, 2015 Werner Almesberger * Copyright 2012, 2015 Werner Almesberger
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
*/ */
@ -89,15 +88,13 @@ bool p2d_no_intersect(const struct p2d *p)
u = u->next; u = u->next;
if (!u || u == p->v) if (!u || u == p->v)
return 1; return 1;
while (u && u->next) { while (u && u->next && u->next != v) {
if (v2d_intersect(v, v->next, u, u->next, if (v2d_intersect(v, v->next, u, u->next,
NULL, NULL) > 0) NULL, NULL) > 0)
return 0; return 0;
u = u->next; u = u->next;
if (u == p->v) if (u == p->v)
break; break;
if (u->next == v)
break;
} }
v = v->next; v = v->next;
if (v == p->v) if (v == p->v)