pub struct CornerRadius2D<T, U> {
pub top_left: Size2D<T, U>,
pub top_right: Size2D<T, U>,
pub bottom_right: Size2D<T, U>,
pub bottom_left: Size2D<T, U>,
}
Expand description
Ellipses that define the radius of the four corners of a 2D box.
Fields§
§top_left: Size2D<T, U>
Top-left corner radius.
top_right: Size2D<T, U>
Top-right corner radius.
bottom_right: Size2D<T, U>
Bottom-right corner radius.
bottom_left: Size2D<T, U>
Bottom-left corner radius.
Implementations§
source§impl<T, U> CornerRadius2D<T, U>
impl<T, U> CornerRadius2D<T, U>
sourcepub fn new(
top_left: Size2D<T, U>,
top_right: Size2D<T, U>,
bottom_right: Size2D<T, U>,
bottom_left: Size2D<T, U>,
) -> CornerRadius2D<T, U>
pub fn new( top_left: Size2D<T, U>, top_right: Size2D<T, U>, bottom_right: Size2D<T, U>, bottom_left: Size2D<T, U>, ) -> CornerRadius2D<T, U>
New with distinct values.
sourcepub fn new_all(radius: Size2D<T, U>) -> CornerRadius2D<T, U>
pub fn new_all(radius: Size2D<T, U>) -> CornerRadius2D<T, U>
New all corners same radius.
sourcepub fn zero() -> CornerRadius2D<T, U>
pub fn zero() -> CornerRadius2D<T, U>
All zeros.
sourcepub fn inflate(self, offsets: SideOffsets2D<T, U>) -> CornerRadius2D<T, U>where
T: AddAssign,
pub fn inflate(self, offsets: SideOffsets2D<T, U>) -> CornerRadius2D<T, U>where
T: AddAssign,
Calculate the corner radius of an outer border around self
to perfectly fit.
sourcepub fn deflate(self, offsets: SideOffsets2D<T, U>) -> CornerRadius2D<T, U>where
T: SubAssign + PartialOrd,
pub fn deflate(self, offsets: SideOffsets2D<T, U>) -> CornerRadius2D<T, U>where
T: SubAssign + PartialOrd,
Calculate the corner radius of an inner border inside self
to perfectly fit.
Trait Implementations§
source§impl<T, U> Clone for CornerRadius2D<T, U>where
T: Clone,
impl<T, U> Clone for CornerRadius2D<T, U>where
T: Clone,
source§fn clone(&self) -> CornerRadius2D<T, U>
fn clone(&self) -> CornerRadius2D<T, U>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T, U> Debug for CornerRadius2D<T, U>where
T: Debug,
impl<T, U> Debug for CornerRadius2D<T, U>where
T: Debug,
source§impl<T, U> Default for CornerRadius2D<T, U>where
T: Default,
impl<T, U> Default for CornerRadius2D<T, U>where
T: Default,
source§fn default() -> CornerRadius2D<T, U>
fn default() -> CornerRadius2D<T, U>
Returns the “default value” for a type. Read more
source§impl<'de, T, U> Deserialize<'de> for CornerRadius2D<T, U>where
T: Deserialize<'de>,
impl<'de, T, U> Deserialize<'de> for CornerRadius2D<T, U>where
T: Deserialize<'de>,
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<CornerRadius2D<T, U>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<CornerRadius2D<T, U>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T, U> PartialEq for CornerRadius2D<T, U>where
T: PartialEq,
impl<T, U> PartialEq for CornerRadius2D<T, U>where
T: PartialEq,
source§impl<T, U> Serialize for CornerRadius2D<T, U>where
T: Serialize,
impl<T, U> Serialize for CornerRadius2D<T, U>where
T: Serialize,
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
source§impl<T, U> Transitionable for CornerRadius2D<T, U>
impl<T, U> Transitionable for CornerRadius2D<T, U>
source§fn lerp(self, to: &CornerRadius2D<T, U>, step: Factor) -> CornerRadius2D<T, U>
fn lerp(self, to: &CornerRadius2D<T, U>, step: Factor) -> CornerRadius2D<T, U>
Sample the linear interpolation from
self
-> to
by step
.impl<T, U> Copy for CornerRadius2D<T, U>where
T: Copy,
impl<T, U> Eq for CornerRadius2D<T, U>where
T: Eq,
Auto Trait Implementations§
impl<T, U> Freeze for CornerRadius2D<T, U>where
T: Freeze,
impl<T, U> RefUnwindSafe for CornerRadius2D<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for CornerRadius2D<T, U>
impl<T, U> Sync for CornerRadius2D<T, U>
impl<T, U> Unpin for CornerRadius2D<T, U>
impl<T, U> UnwindSafe for CornerRadius2D<T, U>where
T: UnwindSafe,
U: UnwindSafe,
Blanket Implementations§
source§impl<T> AnyVarValue for Twhere
T: VarValue,
impl<T> AnyVarValue for Twhere
T: VarValue,
source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Access to mut
dyn Any
methods.source§fn clone_boxed(&self) -> Box<dyn AnyVarValue>
fn clone_boxed(&self) -> Box<dyn AnyVarValue>
Clone the value.
source§fn clone_boxed_var(&self) -> Box<dyn AnyVar>
fn clone_boxed_var(&self) -> Box<dyn AnyVar>
Clone the value into a new boxed
LocalVar<Self>
.source§fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
fn eq_any(&self, other: &(dyn AnyVarValue + 'static)) -> bool
Gets if
self
equals other
.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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more