Condividi tramite


IVerticalFractionMap Interface

Maps between character positions and fractions of the total vertical extent of an ITextView.

Namespace:  Microsoft.VisualStudio.Text.Editor
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

Syntax

'Declaration
Public Interface IVerticalFractionMap
public interface IVerticalFractionMap
public interface class IVerticalFractionMap
type IVerticalFractionMap =  interface end
public interface IVerticalFractionMap

The IVerticalFractionMap type exposes the following members.

Properties

  Name Description
Public property TextView Gets the text view to which this fraction map applies.

Top

Methods

  Name Description
Public method GetBufferPositionAtFraction Gets the buffer position that corresponds to a fraction of the vertical extent of the view, if it exists.
Public method GetFractionAtBufferPosition Gets the fraction of the vertical extent of the view that corresponds to the specified buffer position.

Top

Events

  Name Description
Public event MappingChanged Occurs when the mapping has changed between a character position and its vertical fraction. For example, the view may have re-rendered some lines, changing their font size.

Top

Remarks

Valid text positions range are [0...TextView.TextSnapshot.Length]. Valid scrollbar coordinates are [0.0 ... 1.0]. 0.0 corresponds to the top of the first line in the text view, and 1.0 corresponds to the bottom of the last line in the view.

Not every text position has a unique value. For example, every character on the same text buffer line has the same value, assuming that word wrap is not enabled. This interface is the base type of the IScrollMap interface, which is created using the IScrollMapFactoryService.

See Also

Reference

Microsoft.VisualStudio.Text.Editor Namespace