Allow big shapes to generate partially offscreen

pull/164/head
Amy 2 years ago
parent 743ea56a69
commit d9c920bea0
  1. 4
      components/ShapesBackground.tsx

@ -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 {

Loading…
Cancel
Save