Skip to content

Commit

Permalink
fix borders not in right place
Browse files Browse the repository at this point in the history
  • Loading branch information
ayan4m1 committed Jan 25, 2024
1 parent 8b31ef7 commit 4a75085
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/components/coloree/colorPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,8 @@ export default function ColorPicker({

const path = new Path2D();

path.moveTo(width - 5, height / 2);
path.arc(
width - 5,
height / 2,
radius,
currentAngle,
currentAngle + angle
);
path.moveTo(width, height / 2);
path.arc(width, height / 2, radius, currentAngle, currentAngle + angle);
path.closePath();

ctx.fillStyle = color;
Expand All @@ -58,10 +52,10 @@ export default function ColorPicker({

const border = new Path2D();

border.rect(0, 0, radius, 5);
border.rect(0, 0, radius + 10, 5);

for (const borderAngle of borders) {
ctx.translate(width - 5, height / 2);
ctx.translate(width, height / 2);
ctx.rotate(borderAngle);
ctx.fillStyle = '#ccc';
ctx.fill(border);
Expand Down

0 comments on commit 4a75085

Please sign in to comment.