Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: always close path on circle #829

Merged
merged 1 commit into from
Sep 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/graphic/shape/Circle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,9 @@ class Circle extends Path<CircleProps> {
return new CircleShape();
}

buildPath(ctx: CanvasRenderingContext2D, shape: CircleShape, inBundle: boolean) {
// Better stroking in ShapeBundle
// Always do it may have performence issue ( fill may be 2x more cost)
if (inBundle) {
ctx.moveTo(shape.cx + shape.r, shape.cy);
}
// else {
// if (ctx.allocate && !ctx.data.length) {
// ctx.allocate(ctx.CMD_MEM_SIZE.A);
// }
// }
// Better stroking in ShapeBundle
// ctx.moveTo(shape.cx + shape.r, shape.cy);
buildPath(ctx: CanvasRenderingContext2D, shape: CircleShape) {
ctx.arc(shape.cx, shape.cy, shape.r, 0, Math.PI * 2);
ctx.closePath();
}
};

Expand Down