pub struct Thickness {
pub left: f32,
pub top: f32,
pub right: f32,
pub bottom: f32,
}Expand description
Describes the thickness of a frame around a rectangle (for all four sides). It is primarily used to define margins and to define stroke thickness for various widgets.
Fields§
§left: f32Thickness of the left side of a rectangle.
top: f32Thickness of the top side of a rectangle.
right: f32Thickness of the right side of a rectangle.
bottom: f32Thickness of the bottom side of a rectangle.
Implementations§
source§impl Thickness
impl Thickness
sourcepub fn bottom_right(v: f32) -> Self
pub fn bottom_right(v: f32) -> Self
Thickness for the bottom and right sides of a rectangle.
sourcepub fn bottom_left(v: f32) -> Self
pub fn bottom_left(v: f32) -> Self
Thickness for the bottom and left sides of a rectangle.
sourcepub fn top_bottom(v: f32) -> Self
pub fn top_bottom(v: f32) -> Self
Thickness for the top and bottom sides of a rectangle.
sourcepub fn left_right(v: f32) -> Self
pub fn left_right(v: f32) -> Self
Thickness for the left and right sides of a rectangle.
sourcepub fn offset(&self) -> Vector2<f32>
pub fn offset(&self) -> Vector2<f32>
Returns an offset defined by this thickness. It is just a vector (left, top).
sourcepub fn axes_margin(&self) -> Vector2<f32>
pub fn axes_margin(&self) -> Vector2<f32>
Returns a margin for each axis (horizontal and vertical).
Trait Implementations§
source§impl PartialEq<Thickness> for Thickness
impl PartialEq<Thickness> for Thickness
impl Copy for Thickness
impl StructuralPartialEq for Thickness
Auto Trait Implementations§
impl RefUnwindSafe for Thickness
impl Send for Thickness
impl Sync for Thickness
impl Unpin for Thickness
impl UnwindSafe for Thickness
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere T: 'static,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.