Struct zng::layout::CornerRadius2D
source · 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 From<CornerRadius2D<Px, Px>> for CornerRadius
impl From<CornerRadius2D<Px, Px>> for CornerRadius
source§fn from(corner_radius: CornerRadius2D<Px, Px>) -> CornerRadius
fn from(corner_radius: CornerRadius2D<Px, Px>) -> CornerRadius
From layout corner-radius.
source§impl IntoVar<CornerRadius> for CornerRadius2D<Px, Px>
impl IntoVar<CornerRadius> for CornerRadius2D<Px, Px>
source§fn into_var(self) -> <CornerRadius2D<Px, Px> as IntoVar<CornerRadius>>::Var
fn into_var(self) -> <CornerRadius2D<Px, Px> as IntoVar<CornerRadius>>::Var
From layout corner-radius.
source§fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
fn into_boxed_var(self) -> Box<dyn VarBoxed<T>>where
Self: Sized,
Converts into
BoxedVar<T>
. Read moresource§impl<T, U> PartialEq for CornerRadius2D<T, U>where
T: PartialEq,
impl<T, U> PartialEq for CornerRadius2D<T, U>where
T: PartialEq,
source§impl PxToWr for CornerRadius2D<Px, Px>
impl PxToWr for CornerRadius2D<Px, Px>
source§fn to_wr_device(self) -> <CornerRadius2D<Px, Px> as PxToWr>::AsDevice
fn to_wr_device(self) -> <CornerRadius2D<Px, Px> as PxToWr>::AsDevice
Returns
self
in webrender::units::DevicePixel
units.source§fn to_wr_world(self) -> <CornerRadius2D<Px, Px> as PxToWr>::AsWorld
fn to_wr_world(self) -> <CornerRadius2D<Px, Px> as PxToWr>::AsWorld
Returns
self
in webrender::units::WorldPixel
units.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,
impl IntoValue<CornerRadius> for CornerRadius2D<Px, Px>
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§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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.source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian()
.