reset PRNG - make points generation deterministic

This commit is contained in:
Azgaar 2021-09-16 11:59:00 +03:00 committed by Dranorter
parent 546b1389f6
commit 6447b79c94
2 changed files with 3 additions and 1 deletions

View file

@ -671,6 +671,7 @@ function generateSeed() {
// Place points to calculate Voronoi diagram
function placePoints() {
TIME && console.time("placePoints");
Math.random = aleaPRNG(seed); // reset PRNG
const cellsDesired = +pointsInput.dataset.cells;
const spacing = (grid.spacing = rn(Math.sqrt((graphWidth * graphHeight) / cellsDesired), 2)); // spacing between points before jirrering