Skip to main content

TextHitTestResult Struct

Definition​

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

Holds a hit test result from a Avalonia.Media.TextFormatting.TextLayout.

public struct TextHitTestResult

Inheritance: ValueType -> TextHitTestResult

Implements: IEquatable<TextHitTestResult>

Constructors​

NameDescription
TextHitTestResultNo summary available.

TextHitTestResult Constructor​

public TextHitTestResult(Avalonia.Media.CharacterHit characterHit, int textPosition, bool isInside, bool isTrailing)

Parameters​

characterHit Avalonia.Media.CharacterHit

textPosition int

isInside bool

isTrailing bool

Methods​

NameDescription
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ToStringNo summary available.

Equals overloads​

Equals Method​

public bool Equals(Avalonia.Media.TextHitTestResult other)
Parameters​

other Avalonia.Media.TextHitTestResult

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

ToString Method​

public string ToString()

Returns​

string

Properties​

NameDescription
CharacterHitGets the character hit of the hit test result.
IsInsideGets a value indicating whether the point is inside the bounds of the text.
IsTrailingGets a value indicating whether the hit is on the trailing edge of the character.
TextPositionGets the index of the hit character in the text.

CharacterHit Property​

Gets the character hit of the hit test result.

public Avalonia.Media.CharacterHit CharacterHit { get; set; }

IsInside Property​

Gets a value indicating whether the point is inside the bounds of the text.

public bool IsInside { get; set; }

IsTrailing Property​

Gets a value indicating whether the hit is on the trailing edge of the character.

public bool IsTrailing { get; set; }

TextPosition Property​

Gets the index of the hit character in the text.

public int TextPosition { get; set; }