Table of Contents

Struct Padding

Namespace
MagicUI.Core
Assembly
MagicUI.dll

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 float

The 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 float

The padding to use on the left and right sides

vertical float

The 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 float

The padding to use on the left side

top float

The padding to use on the top side

right float

The padding to use on the right side

bottom float

The padding to use on the bottom side

Fields

Zero

A uniform empty padding

public static Padding Zero

Field Value

Padding

Properties

AddedHeight

The total height added by the padding

public float AddedHeight { get; }

Property Value

float

AddedWidth

The total width added by the padding

public float AddedWidth { get; }

Property Value

float

Bottom

The bottom side padding

public readonly float Bottom { get; }

Property Value

float

Left

The left side padding

public readonly float Left { get; }

Property Value

float

Right

The right side padding

public readonly float Right { get; }

Property Value

float

Top

The top side padding

public readonly float Top { get; }

Property Value

float

Methods

Equals(Padding)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(Padding other)

Parameters

other Padding

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The 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 Padding

The 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 Padding

The padding to outset by

Returns

Padding

A modified padding

Operators

operator ==(Padding, Padding)

public static bool operator ==(Padding left, Padding right)

Parameters

left Padding
right Padding

Returns

bool

operator !=(Padding, Padding)

public static bool operator !=(Padding left, Padding right)

Parameters

left Padding
right Padding

Returns

bool