joshforisha / fast-simplex-noise-js

Fast simplex noise implemented in TypeScript
The Unlicense
66 stars 7 forks source link

Cant use 0 as minimum value #7

Closed ThatsMrTalbot closed 7 years ago

ThatsMrTalbot commented 7 years ago

The constructor contains the line const min = options.min || -1. As zero is falsy this means min can never be set as 0.

https://github.com/joshforisha/fast-simplex-noise-js/blob/2412b38b2a62ca2c7db89efa71d04c4560057339/src/index.ts#L61

A possible fix would be (untested): const min = typeof options.min === "undefined" ? -1 : options.min

joshforisha commented 7 years ago

Oh snap, good catch. I'll fix that in a bit. Thanks!

joshforisha commented 7 years ago

Released v3.2 which adds options validations.

ThatsMrTalbot commented 7 years ago

Awesome! Thanks!