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