Skip to content

Commit

Permalink
don't miss a point
Browse files Browse the repository at this point in the history
  • Loading branch information
mockersf committed Aug 8, 2023
1 parent b7df450 commit b2e8d48
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/input/triangulation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ impl Triangulation {
loop {
let from = edge_iter.next().unwrap();
let next = edge_iter.peek();

aabb_min.x = aabb_min.x.min(from.x);
aabb_min.y = aabb_min.y.min(from.y);
aabb_max.x = aabb_max.x.max(from.x);
aabb_max.y = aabb_max.y.max(from.y);

if let Some(next) = next {
cdt.add_constraint_edge(
Point2 {
Expand All @@ -55,10 +61,6 @@ impl Triangulation {
)
.unwrap();
vertex_pairs.push((*from, **next));
aabb_min.x = aabb_min.x.min(from.x);
aabb_min.y = aabb_min.y.min(from.y);
aabb_max.x = aabb_max.x.max(from.x);
aabb_max.y = aabb_max.y.max(from.y);
} else {
cdt.add_constraint_edge(
Point2 {
Expand Down

0 comments on commit b2e8d48

Please sign in to comment.