The add_node function now wraps around instead of spawning nodes out of bounds
This commit is contained in:
parent
115df64386
commit
a745c63de9
|
@ -647,6 +647,9 @@ impl DelaunayDemo {
|
||||||
let offset = direction / direction.length() * BOING_RADIUS;
|
let offset = direction / direction.length() * BOING_RADIUS;
|
||||||
|
|
||||||
node.0 += offset;
|
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;
|
cycle_completed = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue