mirror of
https://github.com/jhasse/poly2tri.git
synced 2024-11-30 01:03:30 +01:00
This reverts commit e0ba327ed8
.
While the orignal commit silences a compiler warning, it introduces incorrect
behavior in Edge constructor that causes crash later during triangulation.
See #11 for an example of a simple polygon that would cause crash
This commit is contained in:
parent
e6e63dd29e
commit
e66d045060
@ -132,11 +132,11 @@ struct Edge {
|
||||
if (p1.y > p2.y) {
|
||||
q = &p1;
|
||||
p = &p2;
|
||||
} else if (std::abs(p1.y - p2.y) < 1e-10) {
|
||||
} else if (p1.y == p2.y) {
|
||||
if (p1.x > p2.x) {
|
||||
q = &p1;
|
||||
p = &p2;
|
||||
} else if (std::abs(p1.x - p2.x) < 1e-10) {
|
||||
} else if (p1.x == p2.x) {
|
||||
// Repeat points
|
||||
throw std::runtime_error("Edge::Edge: p1 == p2");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user