UNPKG

@dartbot/dartboard

Version:

Dartboard implemented as a vanilla web component

14 lines (13 loc) 781 B
import { PolarPoint } from '../utils'; /** * Set the scale and rotation of the canvas to match the dimensions * of a darboard. Positions will be relative to the center of the board * and units will be in millimeters. This allows us to draw the board * using coordinates that match the physical board. * @param radius The radius of the board in millimeters * @param zoom Zoom level of the board. 1 is normal * @param centerPoint Point on the board that the canvas should be centered on * @param fit How the board should fit in the canvas. 'contain' or 'cover' * @param context Canvas rendering context to draw the board to */ export declare const setContext: (radius: number, zoom: number, centerPoint: PolarPoint, fit: string, context: CanvasRenderingContext2D) => void;