From 70eb6473211919a7f50a65059f6479cc0061d691 Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Fri, 24 Jun 2022 16:29:24 +1000 Subject: [PATCH] Fix rng captcha generation error. Couldnt cherry-pick 0c2e99a96bdcc361079b8af241df95a5acbf22be because I decided to accidentally include an unrelated change --- lib/captcha/getdistorts.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/captcha/getdistorts.js b/lib/captcha/getdistorts.js index 25572df0..f16696c8 100644 --- a/lib/captcha/getdistorts.js +++ b/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},