pub struct FixedRoundedRectangle {
pub corner_radius: f32,
}Expand description
A rectangle with a uniform corner radius in logical points.
RoundedRectangle expresses the corner as a fraction of the shorter side;
this type expresses it as an absolute length — the shape specs give for a
dialog (28dp) or a card (12dp). The rendered radius does not change as the
shape resizes, which is the whole point: spec radii stay constant however
tall or wide the surface ends up.
Fields§
§corner_radius: f32Corner radius in logical points.
Implementations§
Source§impl FixedRoundedRectangle
impl FixedRoundedRectangle
Sourcepub const fn new(corner_radius: f32) -> Self
pub const fn new(corner_radius: f32) -> Self
Creates a rounded rectangle whose corners are corner_radius points.
The radius is clamped to half the shorter side when the shape resolves
against its bounds — a radius wider than the surface degenerates to the
capsule, the same way a normalized 0.5 does.
Trait Implementations§
Source§impl Clone for FixedRoundedRectangle
impl Clone for FixedRoundedRectangle
impl Copy for FixedRoundedRectangle
Source§impl Debug for FixedRoundedRectangle
impl Debug for FixedRoundedRectangle
Source§impl Shape for FixedRoundedRectangle
impl Shape for FixedRoundedRectangle
Source§fn path(&self) -> Self::Iter
fn path(&self) -> Self::Iter
Unit-space approximation only — maximally rounded, like a stadium.
An absolute radius cannot be expressed in normalized commands without
knowing the bounds. Backends must render this shape from
ShapeKind::FixedRoundedRect, not from these commands.
Source§type Iter = [PathCommand; 10]
type Iter = [PathCommand; 10]
path().Source§fn shape_kind(&self) -> ShapeKind
fn shape_kind(&self) -> ShapeKind
Source§impl ShapeExt for FixedRoundedRectangle
impl ShapeExt for FixedRoundedRectangle
Auto Trait Implementations§
impl Freeze for FixedRoundedRectangle
impl RefUnwindSafe for FixedRoundedRectangle
impl Send for FixedRoundedRectangle
impl Sync for FixedRoundedRectangle
impl Unpin for FixedRoundedRectangle
impl UnsafeUnpin for FixedRoundedRectangle
impl UnwindSafe for FixedRoundedRectangle
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
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> ⓘ
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> ⓘ
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