Class LinkHitTester
- Namespace
- SharpConsoleUI.Helpers
- Assembly
- SharpConsoleUI.dll
Resolves a clickable LinkSpan under a control-relative mouse position. Generalizes the per-row link lookup so any markup-rendering control can hit-test links against a per-row list of spans (display-column coordinates).
public static class LinkHitTester
- Inheritance
-
LinkHitTester
- Inherited Members
Methods
FindAt(IReadOnlyList<LinkSpan>, int, int)
Returns the span on rowSpans covering the display column derived from
relativeX minus originX (the row's painted left
origin, i.e. margin + alignment offset), or null if none covers it.
public static LinkSpan? FindAt(IReadOnlyList<LinkSpan> rowSpans, int originX, int relativeX)
Parameters
rowSpansIReadOnlyList<LinkSpan>The link spans on the hit row (display-column coordinates). May be null/empty.
originXintThe row's painted left origin (margin + alignment offset).
relativeXintThe control-relative mouse X position.