Merge pull request #196 from zetashift/master
Add fillCircle and strokeCircle taking a Circle for Context
This commit is contained in:
commit
4b49c77349
1 changed files with 13 additions and 0 deletions
|
@ -374,12 +374,25 @@ proc strokeEllipse*(ctx: Context, center: Vec2, rx, ry: float32) =
|
|||
path.ellipse(center, rx, ry)
|
||||
ctx.stroke(path)
|
||||
|
||||
proc fillCircle*(ctx: Context, circle: Circle) =
|
||||
## Draws a circle that is filled according to the current fillStyle
|
||||
var path: Path
|
||||
path.circle(circle.pos, circle.radius)
|
||||
ctx.fill(path)
|
||||
|
||||
proc fillCircle*(ctx: Context, center: Vec2, radius: float32) =
|
||||
## Draws a circle that is filled according to the current fillStyle.
|
||||
var path: Path
|
||||
path.ellipse(center, radius, radius)
|
||||
ctx.fill(path)
|
||||
|
||||
proc strokeCircle*(ctx: Context, circle: Circle) =
|
||||
## Draws a circle that is stroked (outlined) according to the current
|
||||
## strokeStyle and other context settings.
|
||||
var path: Path
|
||||
path.circle(circle.pos, circle.radius)
|
||||
ctx.stroke(path)
|
||||
|
||||
proc strokeCircle*(ctx: Context, center: Vec2, radius: float32) =
|
||||
## Draws a circle that is stroked (outlined) according to the current
|
||||
## strokeStyle and other context settings.
|
||||
|
|
Loading…
Reference in a new issue