pub struct RoundedRectangle {
pub corner_radius: f32,
}Expand description
A rectangle with uniform corner radius.
Fields§
§corner_radius: f32Corner radius (normalized, 0.0-0.5 range).
Implementations§
Source§impl RoundedRectangle
impl RoundedRectangle
Sourcepub const fn new(corner_radius: f32) -> Self
pub const fn new(corner_radius: f32) -> Self
Creates a new rounded rectangle with the given corner radius.
The radius is normalized, not a length: it is a fraction of the
shape’s shorter side, so 0.5 is fully rounded and anything above that
saturates there. Passing a point value (28.0 for a 56pt-tall row)
therefore lands on 0.5 rather than failing, which is only what was
intended when the shape happens to be that tall.
Reach for Capsule when the intent is “fully rounded at whatever size
this ends up”: it says so directly and cannot drift as the shape resizes.
Trait Implementations§
Source§impl Clone for RoundedRectangle
impl Clone for RoundedRectangle
impl Copy for RoundedRectangle
Source§impl Debug for RoundedRectangle
impl Debug for RoundedRectangle
Source§impl Shape for RoundedRectangle
impl Shape for RoundedRectangle
Source§impl ShapeExt for RoundedRectangle
impl ShapeExt for RoundedRectangle
Auto Trait Implementations§
impl Freeze for RoundedRectangle
impl RefUnwindSafe for RoundedRectangle
impl Send for RoundedRectangle
impl Sync for RoundedRectangle
impl Unpin for RoundedRectangle
impl UnsafeUnpin for RoundedRectangle
impl UnwindSafe for RoundedRectangle
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
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,
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> IdentifiableExt for T
impl<T> IdentifiableExt for T
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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