@mocanvas/editor · class

Point2d

declare class Point2d extends Geometry2d

A single point, with a margin that gives it something to be hit at.

This is the geometry of anything that has a position but no extent — a bare handle, an anchor, the origin of a shape that draws itself entirely from its props.


Methods · 8

constructor(config: Flags & {
getBounds(): Box
getSvgPathData(first?: boolean): string
getVertices(): Vec[]
hitTestLineSegment(A: VecLike, B: VecLike, margin?: number): boolean
hitTestPoint(point: VecLike, margin?: number): boolean
nearestPoint(): Vec
toPathWords(): number[]

Properties · 2

readonly margin: number
readonly point: Vec

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.