struct
Margin
public sealed struct Margin Represents a Rect where each side is the thickness of an edge/padding/margin/border, rather than positions.
Constructors
Margin(Rect r) Margin(Single uniform) Margin(Single horizontal, Single vertical) Margin(Single left, Single top, Single right, Single bottom) Margin(Single? left, Single? top, Single? right, Single? bottom) Properties
| Name | Type | Description |
|---|---|---|
Width | Single | Width of the inner square contained within the margin. |
Height | Single | Height of the inner square contained within the margin. |
Left | Single | Thickness of the left side margin. |
Top | Single | Thickness of the top margin. |
Right | Single | Thickness of the right side margin. |
Bottom | Single | Thickness of the bottom margin. |
Position | Vector2 | Position of the inner top left corder of the margin/border. |
Size | Vector2 | Size of the inner square contained within the margin. |
EdgeSize | Vector2 | When the Rect describes edges, this returns the total size of the edges in each direction |
Methods
Margin EdgeAdd(Margin edges) Where padding is an edge type rect, will return this rect expanded with those edges.
Margin EdgeSubtract(Margin edges) Where padding is an edge type rect, will return this rect expanded with those edges.
Boolean IsNearlyZero(Double tolerance = 1E-06) Returns true if margin is practically zero