From a745c63de96ae7b91159a9ed42d2f5b8d07ed13e Mon Sep 17 00:00:00 2001 From: Emi Simpson Date: Wed, 17 Nov 2021 18:50:36 -0500 Subject: [PATCH] The add_node function now wraps around instead of spawning nodes out of bounds --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4b5a580..c66e0ba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -647,6 +647,9 @@ impl DelaunayDemo { let offset = direction / direction.length() * BOING_RADIUS; node.0 += offset; + node.0.x = node.0.x.rem_euclid(self.width); + node.0.y = node.0.y.rem_euclid(self.width); + cycle_completed = false; break; }