pub struct ClipShape { /* private fields */ }Expand description
Metadata for clipping a view to a shape.
Carries both the structured ShapeKind and the unit-space path. Backends
should prefer the kind: PathCommand coordinates are normalized per axis,
so resolving them against a non-square rect turns a circular corner into an
elliptical one — a fully-rounded clip comes out as an ellipse instead of a
pill. The kind says what the shape is, letting a backend resolve a
normalized radius against the shorter side the way FilledShape already
does. The commands remain the fallback for ShapeKind::CustomPath.
Implementations§
Source§impl ClipShape
impl ClipShape
Sourcepub fn new(shape: impl Shape) -> Self
pub fn new(shape: impl Shape) -> Self
Creates a new clip shape from any type implementing Shape.
Sourcepub const fn kind(&self) -> ShapeKind
pub const fn kind(&self) -> ShapeKind
Returns the structured shape kind. Prefer this over Self::commands;
see the type documentation.
Sourcepub fn commands(&self) -> &[PathCommand]
pub fn commands(&self) -> &[PathCommand]
Returns the unit-space path commands.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ClipShape
impl RefUnwindSafe for ClipShape
impl Send for ClipShape
impl Sync for ClipShape
impl Unpin for ClipShape
impl UnsafeUnpin for ClipShape
impl UnwindSafe for ClipShape
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, 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