vyaz-monorepo / renderers/src / charAtPoint
Function: charAtPoint()
charAtPoint(
lines,px,py):CharPos|null
Defined in: renderers/src/interactive.ts:129
Find the character position nearest to the given pixel coordinates.
Uses a two-pass approach:
- Find the nearest line by Y distance (closest baseline).
- Within that line, find the nearest character by X distance (using glyph advances or fallback uniform widths).
Returns null if lines is empty.
Parameters
lines
Line[]
px
number
py
number
Returns
CharPos | null
