Skip to content

Commit 06aa9fb

Browse files
committed
Improved quality of small arcs.
1 parent 83212d9 commit 06aa9fb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/canvasContext.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,11 @@ CanvasContext.prototype.arc = function CanvasContext_arc(x, y, radius, startAngl
252252
return;
253253
}
254254

255-
const ARC_LENGTH_PIXELS = 3;
255+
const TARGET_CHORD_LENGTH_PIXELS = 3;
256256

257-
var sectors = Math.floor((Math.PI * radius * 2) / ARC_LENGTH_PIXELS);
258-
if (sectors < 4) {
259-
sectors = 4;
257+
var sectors = Math.floor((Math.PI * radius * 2) / TARGET_CHORD_LENGTH_PIXELS);
258+
if (sectors < 9) {
259+
sectors = 9;
260260
}
261261

262262
var sectorAngle = Math.PI * 2 / sectors;

0 commit comments

Comments
 (0)