pub enum RoundedCorner {
Capsule,
Manual {
radius: Dp,
g2_k_value: f32,
},
Relative {
fraction: f32,
offset: Dp,
g2_k_value: f32,
},
}Expand description
A fixed or size-relative corner radius with per-corner curvature.
Variants§
Capsule
Capsule radius derived from min(width, height) / 2.0, with
CAPSULE_G2_K_VALUE.
Manual
Manual radius (in Dp) with per-corner G2.
Fields
§
radius: DpCorner radius in device-independent pixels.
Relative
A fraction of the shortest edge plus a fixed offset, clamped to fit.
Implementations§
Source§impl RoundedCorner
impl RoundedCorner
Sourcepub const ZERO: RoundedCorner
pub const ZERO: RoundedCorner
A corner with zero radius.
Sourcepub const fn new(radius: Dp) -> RoundedCorner
pub const fn new(radius: Dp) -> RoundedCorner
Creates a rounded corner with the specified radius and a default G2 k value.
Sourcepub const fn manual(radius: Dp, g2_k_value: f32) -> RoundedCorner
pub const fn manual(radius: Dp, g2_k_value: f32) -> RoundedCorner
Helper to create a manual corner.
Sourcepub const fn relative(
fraction: f32,
offset: Dp,
g2_k_value: f32,
) -> RoundedCorner
pub const fn relative( fraction: f32, offset: Dp, g2_k_value: f32, ) -> RoundedCorner
Creates a corner that responds to the actual measured size.
The final radius is limited to half the shortest edge. Non-finite fractions and offsets contribute zero to the radius.
Trait Implementations§
Source§impl Clone for RoundedCorner
impl Clone for RoundedCorner
Source§fn clone(&self) -> RoundedCorner
fn clone(&self) -> RoundedCorner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RoundedCorner
Source§impl Debug for RoundedCorner
impl Debug for RoundedCorner
Source§impl PartialEq for RoundedCorner
impl PartialEq for RoundedCorner
impl StructuralPartialEq for RoundedCorner
Auto Trait Implementations§
impl Freeze for RoundedCorner
impl RefUnwindSafe for RoundedCorner
impl Send for RoundedCorner
impl Sync for RoundedCorner
impl Unpin for RoundedCorner
impl UnsafeUnpin for RoundedCorner
impl UnwindSafe for RoundedCorner
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> 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>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
Converts
&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)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.