Skip to content

Commit

Permalink
Merge pull request #2 from Yohh/yoh/enhance-filled-shapes
Browse files Browse the repository at this point in the history
Yoh/enhance filled shapes
  • Loading branch information
Yohh authored Aug 23, 2024
2 parents 0f60a17 + 7bd16c5 commit a0fb307
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 6 additions & 3 deletions components/helpers/drawElipse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ export const drawElipse = (
0,
2 * Math.PI
);
if (isFilled) {
ctx.fillStyle = colors
.find((color) => color.rgb === primaryColor)
?.rgba.replace("0.5)", "0.3)")!;
ctx.fill();
}
ctx.stroke();

ctx.strokeStyle = colors.find(
(color) => color.rgb === primaryColor
)?.rgba!;
ctx.setLineDash([2, 5]);
ctx.rect(startX, startY, width, height);
ctx.stroke();
Expand Down
9 changes: 6 additions & 3 deletions components/helpers/drawRect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,15 @@ export const drawRect = (
ctx.strokeStyle = colors.find(
(color) => color.rgb === primaryColor
)?.rgba!;
ctx.fillStyle = colors
.find((color) => color.rgb === primaryColor)
?.rgba.replace("0.5)", "0.3)")!;
ctx.setLineDash([5, 5]);
ctx.strokeRect(startX, startY, width, height);
if (isFilled) {
ctx.fillRect(startX, startY, width, height);
}

ctx.strokeStyle = colors.find(
(color) => color.rgb === primaryColor
)?.rgba!;
ctx.setLineDash([2, 5]);
ctx.beginPath();
ctx.moveTo(startX, startY + height / 2);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "simple-sketch",
"name": "simple-sketch",
"version": "1.0.3",
"version": "1.0.6",
"minAppVersion": "0.15.0",
"description": "A simple sketch plugin.",
"author": "Yoh",
Expand Down

0 comments on commit a0fb307

Please sign in to comment.