Struct Padding
Describes the padding around an element
public struct Padding : IEquatable<Padding>
- Implements
- Inherited Members
Constructors
Padding(float)
Creates a uniform padding
public Padding(float uniform)
Parameters
uniform
floatThe padding to use on all sides
Padding(float, float)
Creates a padding with the same top/bottom and left/right components
public Padding(float horizontal, float vertical)
Parameters
horizontal
floatThe padding to use on the left and right sides
vertical
floatThe padding to use on the top and bottom sides
Padding(float, float, float, float)
Creates a padding with 4 custom sides
public Padding(float left, float top, float right, float bottom)
Parameters
left
floatThe padding to use on the left side
top
floatThe padding to use on the top side
right
floatThe padding to use on the right side
bottom
floatThe padding to use on the bottom side
Fields
Zero
A uniform empty padding
public static Padding Zero
Field Value
Properties
AddedHeight
The total height added by the padding
public float AddedHeight { get; }
Property Value
AddedWidth
The total width added by the padding
public float AddedWidth { get; }
Property Value
Bottom
The bottom side padding
public readonly float Bottom { get; }
Property Value
Left
The left side padding
public readonly float Left { get; }
Property Value
Right
The right side padding
public readonly float Right { get; }
Property Value
Top
The top side padding
public readonly float Top { get; }
Property Value
Methods
Equals(Padding)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Padding other)
Parameters
other
PaddingAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Inset(Padding)
Insets this padding by another padding. In other words, makes the padding smaller by the size of the other padding on each side, stopping at 0.
public Padding Inset(Padding other)
Parameters
other
PaddingThe padding to inset by
Returns
- Padding
A modified padding
Outset(Padding)
Outsets this padding by another padding. In other words, makes the padding larger by the size of the other padding on each side.
public Padding Outset(Padding other)
Parameters
other
PaddingThe padding to outset by
Returns
- Padding
A modified padding
Operators
operator ==(Padding, Padding)
public static bool operator ==(Padding left, Padding right)
Parameters
Returns
operator !=(Padding, Padding)
public static bool operator !=(Padding left, Padding right)