Table of Contents

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

rowSpans IReadOnlyList<LinkSpan>

The link spans on the hit row (display-column coordinates). May be null/empty.

originX int

The row's painted left origin (margin + alignment offset).

relativeX int

The control-relative mouse X position.

Returns

LinkSpan?

The covering LinkSpan, or null if none covers the column.