Skip to content

Documentation / @ripl/terminal / isPointOnContours

Function: isPointOnContours() ​

isPointOnContours(contours, x, y, width, closed?): boolean

Defined in: terminal/src/hit.ts:80

Tests whether a point falls within width of any edge of the given contours.

Parameters ​

ParameterTypeDefault valueDescription
contoursVertex[][]undefinedThe contours to test against.
xnumberundefinedX coordinate of the point.
ynumberundefinedY coordinate of the point.
widthnumberundefinedThe stroke width the contours would be drawn with.
closedbooleantrueWhether each contour's last point joins back to its first.

Returns ​

boolean

true when the point is on the stroke.