f
This commit is contained in:
parent
acc1d6bc93
commit
6567a0a8da
1 changed files with 2 additions and 1 deletions
|
@ -637,11 +637,12 @@ proc polygon*(
|
|||
if sides <= 2:
|
||||
raise newException(PixieError, "Invalid polygon sides value")
|
||||
path.moveTo(x + size * sin(0.0), y - size * cos(0.0))
|
||||
for side in 1 .. sides:
|
||||
for side in 1 .. sides - 1:
|
||||
path.lineTo(
|
||||
x + size * sin(side.float32 * 2.0 * PI / sides.float32),
|
||||
y - size * cos(side.float32 * 2.0 * PI / sides.float32)
|
||||
)
|
||||
path.closePath()
|
||||
|
||||
proc polygon*(
|
||||
path: Path, pos: Vec2, size: float32, sides: int
|
||||
|
|
Loading…
Reference in a new issue