Struct ScrollbarMetrics
- Namespace
- SharpConsoleUI.Helpers.Scrollbar
- Assembly
- SharpConsoleUI.dll
Everything the scrollbar maths needs, on one axis. Axis-agnostic: "length" and "extent" are rows for a vertical bar and columns for a horizontal one.
public readonly record struct ScrollbarMetrics : IEquatable<ScrollbarMetrics>
- Implements
- Inherited Members
- Extension Methods
Constructors
ScrollbarMetrics(int, int, int, int, int)
Everything the scrollbar maths needs, on one axis. Axis-agnostic: "length" and "extent" are rows for a vertical bar and columns for a horizontal one.
public ScrollbarMetrics(int TrackLength, int ContentExtent, int ViewportExtent, int Offset, int MinThumbLength = 1)
Parameters
TrackLengthintCells available to the whole bar, arrows included.
ContentExtentintTotal length of the content being scrolled.
ViewportExtentintLength of the visible window onto that content.
OffsetintCurrent scroll offset.
MinThumbLengthintSmallest thumb the bar may draw (at least 1).
Properties
ContentExtent
Total length of the content being scrolled.
public int ContentExtent { get; init; }
Property Value
MinThumbLength
Smallest thumb the bar may draw (at least 1).
public int MinThumbLength { get; init; }
Property Value
Offset
Current scroll offset.
public int Offset { get; init; }
Property Value
TrackLength
Cells available to the whole bar, arrows included.
public int TrackLength { get; init; }
Property Value
ViewportExtent
Length of the visible window onto that content.
public int ViewportExtent { get; init; }