UNPKG

@ue-too/board

Version:
31 lines (30 loc) 1.32 kB
import { Point } from "@ue-too/math"; export declare function drawArrow(context: CanvasRenderingContext2D, cameraZoomLevel: number, startPoint: Point, endPoint: Point, width?: number, arrowRatio?: number): void; export declare const MAJOR_TICK_LENGTH = 30; export declare const MINOR_TICK_LENGTH: number; export declare const HALF_TICK_LENGTH: number; export declare const TEXT_MAJOR_TICK_OFFSET = 10; export declare const TEXT_HALF_TICK_OFFSET = 2.5; export declare const TEXT_MAJOR_TICK_FONT_SIZE = 20; export declare const TEXT_HALF_TICK_FONT_SIZE = 10; /** * @description Draws a ruler on the canvas. * argument points are in world space * * @category Utils * */ export declare function drawRuler(context: CanvasRenderingContext2D, topLeftCorner: Point, topRightCorner: Point, bottomLeftCorner: Point, alignCoordinateSystem: boolean, cameraZoomLevel: number): void; export declare function calculateTickValues(minValue: number, maxValue: number, orderOfMagnitude?: number): { minMajorTickValue: number; maxMajorTickValue: number; majorTickStep: number; minMinTickValue: number; maxMaxTickValue: number; minTickStep: number; minHalfTickValue: number; maxHalfTickValue: number; halfTickStep: number; calibrationMultiplier: number; normalizedOrderOfMagnitude: number; };