captcha/getdistorts: randomRange requires integers

jschan
some random guy 2 years ago committed by Thomas Lynch
parent 3090f2677d
commit f6631068d1
Signed by: fatchan
GPG Key ID: 112884AA57DF40B1
  1. 4
      lib/captcha/getdistorts.js

@ -13,8 +13,8 @@ module.exports = async (width, height, numDistorts, distortion) => {
for (let i = 0; i < randNumDistorts; i++) {
//start and end of divided width
const divStart = (div * i)
, divEnd = (div * (i + 1));
const divStart = Math.floor(div * i)
, divEnd = Math.floor(div * (i + 1));
//origin coordinate for distortion point
const originx = await randomRange(divStart, divEnd)

Loading…
Cancel
Save