Table of Contents

Struct CharacterHit

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

Represents information about a character hit within a glyph run.

public readonly struct CharacterHit : IEquatable<CharacterHit>
Implements
Inherited Members

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

CharacterHit(int, int)

Initializes a new instance of the CharacterHit structure.

public CharacterHit(int firstCharacterIndex, int trailingLength = 0)

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.

Properties

FirstCharacterIndex

Gets the index of the first character that got hit.

public int FirstCharacterIndex { get; }

Property Value

int

TrailingLength

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

public int TrailingLength { get; }

Property Value

int

Methods

Equals(CharacterHit)

public bool Equals(CharacterHit other)

Parameters

other CharacterHit

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

Operators

operator ==(CharacterHit, CharacterHit)

public static bool operator ==(CharacterHit left, CharacterHit right)

Parameters

left CharacterHit
right CharacterHit

Returns

bool

operator !=(CharacterHit, CharacterHit)

public static bool operator !=(CharacterHit left, CharacterHit right)

Parameters

left CharacterHit
right CharacterHit

Returns

bool