pub struct RoundedRect { /* private fields */ }Expand description
A rectangle geometry with rounded corners.
Not a painting primitive. For that, see crate::RectShape.
Implementations§
Source§impl RoundedRect
impl RoundedRect
Sourcepub fn new(rect: Rect, corner_radius: impl Into<CornerRadiusF32>) -> RoundedRect
pub fn new(rect: Rect, corner_radius: impl Into<CornerRadiusF32>) -> RoundedRect
The corner radius is clamped to half the size of the rectangle.
pub fn rect(&self) -> Rect
pub fn corner_radius(&self) -> CornerRadiusF32
Sourcepub fn into_parts(self) -> (Rect, CornerRadiusF32)
pub fn into_parts(self) -> (Rect, CornerRadiusF32)
Split into the rectangle and the corner radius.
Sourcepub fn expand(self, amount: f32) -> RoundedRect
pub fn expand(self, amount: f32) -> RoundedRect
Expand the rectangle and the corner radii by the given amount.
Sourcepub fn shrink(self, amount: f32) -> RoundedRect
pub fn shrink(self, amount: f32) -> RoundedRect
Shrink the rectangle and the corner radii by the given amount.
Trait Implementations§
Source§impl Clone for RoundedRect
impl Clone for RoundedRect
Source§fn clone(&self) -> RoundedRect
fn clone(&self) -> RoundedRect
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 RoundedRect
Source§impl Debug for RoundedRect
impl Debug for RoundedRect
Source§impl From<Rect> for RoundedRect
impl From<Rect> for RoundedRect
Source§fn from(rect: Rect) -> RoundedRect
fn from(rect: Rect) -> RoundedRect
Converts to this type from the input type.
Source§impl PartialEq for RoundedRect
impl PartialEq for RoundedRect
impl StructuralPartialEq for RoundedRect
Auto Trait Implementations§
impl Forget for RoundedRect
impl Freeze for RoundedRect
impl Move for RoundedRect
impl RefUnwindSafe for RoundedRect
impl Send for RoundedRect
impl Sync for RoundedRect
impl Unpin for RoundedRect
impl UnsafeUnpin for RoundedRect
impl UnwindSafe for RoundedRect
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> 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