pub struct Padding {
    pub l: f32,
    pub t: f32,
    pub r: f32,
    pub b: f32,
}
Expand description

Inner padding dimensions that should be applied on top of a Rect or other object that defines dimensions.

TODO(JP): these values can be negative, which can be quite confusing, but we seem to actually honor that in the layout boxes code. Might be good to look into that and see if we should forbid that or not (we seem to never actually do that yet).

Fields

l: f32t: f32r: f32b: f32

Implementations

TODO(JP): Replace these with Padding::default() when https://github.com/rust-lang/rust/issues/67792 gets done

Helper function to set vertical and horizontal padding This is a common case when top=bottom left=right

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.