jwagner / simplex-noise.js

A fast simplex noise implementation in Javascript / Typescript.
MIT License
1.61k stars 130 forks source link

Fixing falsy seed values #25

Closed tiborsaas closed 3 years ago

tiborsaas commented 5 years ago

If you set seed to zero or empty string, then SimplexNoise will generate random noise which might not be expected as the seed value was set. Now it will only be random if 'randomOrSeed' not set at all.

jwagner commented 5 years ago

Hi @tiborsaas,

Sorry for the slow reply. I must have missed your pull request. I agree that an explicit check for undefined could be what users expect. However this does change the user-facing api/behavior and so would be a new major version. I don't think the benefits justify that. I'll keep the PR open and might include it if I release another major version for other reasons.

I hope you understand.

Cheers, Jonas

tiborsaas commented 5 years ago

Better later than never :)

I agree, once you do a new major release it's totally fine to bundle it with other features.

jwagner commented 3 years ago

This has been addressed in 3.0 by using a default value for the randomOrSeed argument. Thanks again for pointing out the problem!