diff --git a/src/main.rs b/src/main.rs index 1359506..157910a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -464,6 +464,15 @@ impl DelaunayDemo { }; let edge_0 = edge.0.get().as_f32(); let edge_1 = edge.1.get().as_f32(); + + if + edge_0.x < 0.0 || edge_0.x > screen_width() + || edge_0.y < 0.0 || edge_0.y > screen_height() + || edge_1.x < 0.0 || edge_1.x > screen_width() + || edge_1.y < 0.0 || edge_1.y > screen_height() + { + continue; //don't draw container nodes + } draw_line( edge_0.x, edge_0.y,