Merge pull request #199 from guzba/master

circle from bumpy to paths.nim
This commit is contained in:
treeform 2021-05-22 17:41:43 -07:00 committed by GitHub
commit 304e0a5554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View file

@ -1,7 +1,8 @@
import bumpy, chroma, flatty/binny, os, pixie/blends, pixie/common,
pixie/context, pixie/fileformats/bmp, pixie/fileformats/gif,
pixie/fileformats/jpg, pixie/fileformats/png, pixie/fileformats/svg,
pixie/fonts, pixie/images, pixie/masks, pixie/paints, pixie/paths, strutils, vmath
pixie/fonts, pixie/images, pixie/masks, pixie/paints, pixie/paths, strutils,
vmath
export blends, bumpy, chroma, common, context, fonts, images, masks, paints,
paths, vmath

View file

@ -577,6 +577,10 @@ proc circle*(path: var Path, center: Vec2, r: float32) {.inline.} =
## Adds a circle.
path.ellipse(center.x, center.y, r, r)
proc circle*(path: var Path, circle: Circle) {.inline.} =
## Adds a circle.
path.ellipse(circle.pos.x, circle.pos.y, circle.radius, circle.radius)
proc polygon*(path: var Path, x, y, size: float32, sides: int) =
## Adds an n-sided regular polygon at (x, y) with the parameter size.
path.moveTo(x + size * cos(0.0), y + size * sin(0.0))