UNPKG

@dartbot/dartboard

Version:

Dartboard implemented as a vanilla web component

17 lines 567 B
import { getPoint } from '../utils'; export const drawHits = (theme, context, hits) => { context.save(); context.fillStyle = theme.hitFillColor; context.strokeStyle = theme.hitStokeColor; context.lineWidth = theme.hitStrokeWidth; const radius = theme.hitRadius; for (const hit of hits) { const point = getPoint(hit); context.beginPath(); context.arc(point.x, point.y, radius, 0, 2 * Math.PI, false); context.fill(); context.stroke(); } context.restore(); }; //# sourceMappingURL=draw-hits.js.map