Allow big shapes to generate partially offscreen
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
743ea56a69
commit
d9c920bea0
|
@ -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…
Reference in New Issue