Skip to main content

CharacterHit Struct

Definition​

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

Represents information about a character hit within a glyph run.

public struct CharacterHit

Inheritance: ValueType -> CharacterHit

Implements: IEquatable<CharacterHit>

Remarks​

The CharacterHit structure provides information about the index of the first character that got hit as well as information about leading or trailing edge.

Constructors​

NameDescription
CharacterHitInitializes a new instance of the Avalonia.Media.CharacterHit structure.

CharacterHit Constructor​

Initializes a new instance of the Avalonia.Media.CharacterHit structure.

public CharacterHit(int firstCharacterIndex, int trailingLength)

Parameters​

firstCharacterIndex int

Index of the first character that got hit.

trailingLength int

In the case of a leading edge, this value is 0. In the case of a trailing edge, this value is the number of code points until the next valid caret position.

Methods​

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

Equals overloads​

Equals Method​

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

other Avalonia.Media.CharacterHit

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

Properties​

NameDescription
FirstCharacterIndexGets the index of the first character that got hit.
TrailingLengthGets the trailing length value for the character that got hit.

FirstCharacterIndex Property​

Gets the index of the first character that got hit.

public int FirstCharacterIndex { get; set; }

TrailingLength Property​

Gets the trailing length value for the character that got hit.

public int TrailingLength { get; set; }

Remarks​

In the case of a leading edge, this value is 0. In the case of a trailing edge, this value is the number of code points until the next valid caret position.