Skip to content

Commit

Permalink
circle includes fill bc im the boss
Browse files Browse the repository at this point in the history
  • Loading branch information
ELI7VH committed Jan 4, 2025
1 parent 35b4069 commit 9e5df61
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dank-inc/sketchy",
"version": "1.0.0",
"version": "1.0.1",
"author": "Elijah Lucian",
"description": "A Super-dank sketching library built with ♥ and typescript!",
"repository": {
Expand Down
17 changes: 15 additions & 2 deletions src/lib/helpers/draw.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
type ArtOptions = {
fill?: boolean
stroke?: boolean
start?: number
end?: number
}

export const arc = (
context: CanvasRenderingContext2D,
x: number,
y: number,
r: number,
start = 0,
end = Math.PI * 2,
{
fill = true,
stroke = false,
start = 0,
end = Math.PI * 2,
}: ArtOptions = {},
) => {
//
context.beginPath()

context.arc(x, y, r, start, end)

context.closePath()
if (stroke) context.stroke()
if (fill) context.fill()
}

export const saver = (context: CanvasRenderingContext2D, body: () => void) => {
Expand Down

0 comments on commit 9e5df61

Please sign in to comment.