Condividi tramite


ITextViewLine.GetBufferPositionFromXCoordinate Method

Definition

Overloads

GetBufferPositionFromXCoordinate(Double)

Gets the buffer position of the character whose character bounds contains the given x-coordinate.

GetBufferPositionFromXCoordinate(Double, Boolean)

Gets the buffer position of the character whose character bounds contains the given x-coordinate.

GetBufferPositionFromXCoordinate(Double)

Gets the buffer position of the character whose character bounds contains the given x-coordinate.

public:
 Nullable<Microsoft::VisualStudio::Text::SnapshotPoint> GetBufferPositionFromXCoordinate(double xCoordinate);
public Microsoft.VisualStudio.Text.SnapshotPoint? GetBufferPositionFromXCoordinate (double xCoordinate);
abstract member GetBufferPositionFromXCoordinate : double -> Nullable<Microsoft.VisualStudio.Text.SnapshotPoint>
Public Function GetBufferPositionFromXCoordinate (xCoordinate As Double) As Nullable(Of SnapshotPoint)

Parameters

xCoordinate
Double

The x-coordinate of the desired character.

Returns

The text buffer-based point of the character at x, or null if there is no character at that position.

Remarks

This is equivalent to GetBufferPositionFromXCoordinate(xCoordinate, false).

Applies to

GetBufferPositionFromXCoordinate(Double, Boolean)

Gets the buffer position of the character whose character bounds contains the given x-coordinate.

public:
 Nullable<Microsoft::VisualStudio::Text::SnapshotPoint> GetBufferPositionFromXCoordinate(double xCoordinate, bool textOnly);
public Microsoft.VisualStudio.Text.SnapshotPoint? GetBufferPositionFromXCoordinate (double xCoordinate, bool textOnly);
abstract member GetBufferPositionFromXCoordinate : double * bool -> Nullable<Microsoft.VisualStudio.Text.SnapshotPoint>
Public Function GetBufferPositionFromXCoordinate (xCoordinate As Double, textOnly As Boolean) As Nullable(Of SnapshotPoint)

Parameters

xCoordinate
Double

The x-coordinate of the desired character.

textOnly
Boolean

If true, then this method will return null if xCoordinate is over an adornment.

Returns

The text buffer-based point of the character at x, or null if there is no character at that position.

Remarks

Please note that the rightmost edge of a character bound is considered to be contained in its following character.

The rightmost edge of the last character's bounds don't map to any character.

If textOnly is true and xCoordinate is over an adornment, then the text position assoicated with the adornment is returned.

Applies to