UNPKG

@dartbot/dartboard

Version:

Dartboard implemented as a vanilla web component

19 lines (18 loc) 800 B
import { PolarPoint } from './polar-point'; /** * Translate a point from canvas coordinates to board coordinates. * Correct for the scale and rotation of the canvas so that the * point is in the same coordinate system as the dartboard. * @param width Width of the canvas * @param height Height of the canvas * @param zoomVal Zoom value of the component * @param centerPoint Center point offset of the component * @param radius Radius of the dartboard * @param fit Fit mode of the component * @param xCoord X coordinate to translate * @param yCoord Y coordinate to translate */ export declare const translateCoords: (width: number, height: number, zoomVal: number, centerPoint: PolarPoint, radius: number, fit: string, xCoord: number, yCoord: number) => { x: number; y: number; };