public readonly struct StackF
A series of horizontally stacked rectangles.

Properties

Bounds

#
public RectangleF Bounds { get; }
Gets the outer bounds of the stack.

Count

#
public int Count { get; }
Gets the number of rectangles making up this stack.

Indexers

this[]

#
public RectangleF this[int index] { get; }
Gets the rectangle within the stack at the given index.
index (int)

Methods

Adjust

#
public StackF Adjust(int index, float width)
Adjust the width of a box.
index (int)Index of box.
width (float)New width of box.

Append

#
public StackF Append(float width)
Append a box at the end of the stack.
width (float)Width of box to append.

Ceiling

#
public StackF Ceiling()
Round all values to the nearest bigger integer. This operation may increase the bounds by more than a single unit.

CreateFromMiddleLeft

#
public static StackF CreateFromMiddleLeft(PointF anchor, params SizeF[] sizes)
Create a stack from the middle left corner and a set of element widths.
anchor (PointF)Middle left corner of bounds.
sizes (params SizeF[])Sizes of each segment. Note that the highest segments overwrites the other heights.

CreateFromTopLeft

#
public static StackF CreateFromTopLeft(PointF anchor, float height, params float[] widths)
Create a stack from the upper left corner and a set of element widths.
anchor (PointF)Top left corner of bounds.
height (float)Height of bounds.
widths (params float[])Widths of each segment.

CreateFromTopLeft

#
public static StackF CreateFromTopLeft(PointF anchor, params SizeF[] sizes)
Create a stack from the upper left corner and a set of element widths.
anchor (PointF)Top left corner of bounds.
sizes (params SizeF[])Sizes of each segment. Note that the highest segments overwrites the other heights.

CreateSingular

#
public static StackF CreateSingular(RectangleF bounds)
Create a stack containing a single item.
bounds (RectangleF)

Grow

#
public StackF Grow(int index, float width)
Append a certain width to an existing element.
index (int)Index of element to adjust.
width (float)Width to append (or subtract, if width is negative).

Move

#
public StackF Move(float dx, float dy)
Move this stack.
dx (float)
dy (float)

Transition

#
public float Transition(int index)
Gets the x-coordinate of the transition between rectangles. index=0 refers to the left boundary of the leftmost rectangle, index=Count+1 refers to the right boundary of the rightmost rectangle.
index (int)

WithHeight

#
public StackF WithHeight(float newHeight)
Adjust the vertical dimensions of the stack.
newHeight (float)

WithTop

#
public StackF WithTop(float newTop)
Adjust the vertical dimensions of the stack.
newTop (float)

WithVertical

#
public StackF WithVertical(float newTop, float newHeight)
Adjust the vertical dimensions of the stack.
newTop (float)
newHeight (float)