Allow big shapes to generate partially offscreen
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Amy 2021-08-26 16:15:34 -04:00
parent 743ea56a69
commit d9c920bea0
1 changed files with 3 additions and 1 deletions

View File

@ -248,7 +248,9 @@ function getVerticalOffset(boxHeight: number, shape: ShapeType): number {
function getHorizontalOffset(boxWidth: number, shape: ShapeType): number {
const padding = shapesSizes[shape]["width"];
return Math.floor(Math.random() * (boxWidth - padding));
return shapesSizes[shape]["size"] == "big"
? Math.floor(Math.random() * (boxWidth - padding / 2) - padding / 2)
: Math.floor(Math.random() * (boxWidth - padding));
}
function getRandomAngle(shape: ShapeType): number {