From 924cb5487126960e2b1dbe832ff93281f9f360f5 Mon Sep 17 00:00:00 2001 From: pissang Date: Sat, 18 Sep 2021 16:14:43 +0800 Subject: [PATCH] fix: always close path on circle --- src/graphic/shape/Circle.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/graphic/shape/Circle.ts b/src/graphic/shape/Circle.ts index dd7508087..00adccf11 100644 --- a/src/graphic/shape/Circle.ts +++ b/src/graphic/shape/Circle.ts @@ -25,20 +25,9 @@ class Circle extends Path { 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(); } };