Fix rng captcha generation error. Couldnt cherry-pick 0c2e99a96b because I decided to accidentally include an unrelated change

indiachan-spamvector
Thomas Lynch 2 years ago
parent c1b739ca16
commit 70eb647321
Signed by: fatchan
GPG Key ID: 112884AA57DF40B1
  1. 4
      lib/captcha/getdistorts.js

@ -21,8 +21,8 @@ module.exports = async (width, height, numDistorts, distortion) => {
, originy = await randomRange(0, height);
//destionation coordinate for distortion point
const destx = await randomRange(Math.max(distortion, originx - distortion), Math.min(width - distortion, originx + distortion))
, desty = await randomRange(Math.max(distortion, originy - (distortion * 2)), Math.min(height - distortion, originy + (distortion * 2)));
const destx = await randomRange(Math.max(distortion, originx - distortion), Math.min(width - distortion, originx + distortion)+1)
, desty = await randomRange(Math.max(distortion, originy - (distortion * 2)), Math.min(height - distortion, originy + (distortion * 2))+1);
distorts.push([
{x:originx,y:originy},

Loading…
Cancel
Save