pub struct CornerRadius2D<T, U> {
pub top_left: Size2D<T, U>,
pub top_right: Size2D<T, U>,
pub bottom_right: Size2D<T, U>,
pub bottom_left: Size2D<T, U>,
}
Expand description
Ellipses that define the radius of the four corners of a 2D box.
Fields§
§top_left: Size2D<T, U>
Top-left corner radius.
top_right: Size2D<T, U>
Top-right corner radius.
bottom_right: Size2D<T, U>
Bottom-right corner radius.
bottom_left: Size2D<T, U>
Bottom-left corner radius.
Implementations§
source§impl<T: Copy + Zero, U> CornerRadius2D<T, U>
impl<T: Copy + Zero, U> CornerRadius2D<T, U>
sourcepub fn new(
top_left: Size2D<T, U>,
top_right: Size2D<T, U>,
bottom_right: Size2D<T, U>,
bottom_left: Size2D<T, U>,
) -> Self
pub fn new( top_left: Size2D<T, U>, top_right: Size2D<T, U>, bottom_right: Size2D<T, U>, bottom_left: Size2D<T, U>, ) -> Self
New with distinct values.
sourcepub fn inflate(self, offsets: SideOffsets2D<T, U>) -> Selfwhere
T: AddAssign,
pub fn inflate(self, offsets: SideOffsets2D<T, U>) -> Selfwhere
T: AddAssign,
Calculate the corner radius of an outer border around self
to perfectly fit.
sourcepub fn deflate(self, offsets: SideOffsets2D<T, U>) -> Selfwhere
T: SubAssign + PartialOrd,
pub fn deflate(self, offsets: SideOffsets2D<T, U>) -> Selfwhere
T: SubAssign + PartialOrd,
Calculate the corner radius of an inner border inside self
to perfectly fit.
Trait Implementations§
source§impl<T: Clone, U> Clone for CornerRadius2D<T, U>
impl<T: Clone, U> Clone for CornerRadius2D<T, U>
source§impl<T: Debug, U> Debug for CornerRadius2D<T, U>
impl<T: Debug, U> Debug for CornerRadius2D<T, U>
source§impl<T: Default, U> Default for CornerRadius2D<T, U>
impl<T: Default, U> Default for CornerRadius2D<T, U>
source§impl<'de, T, U> Deserialize<'de> for CornerRadius2D<T, U>where
T: Deserialize<'de>,
impl<'de, T, U> Deserialize<'de> for CornerRadius2D<T, U>where
T: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<T: PartialEq, U> PartialEq for CornerRadius2D<T, U>
impl<T: PartialEq, U> PartialEq for CornerRadius2D<T, U>
source§impl<T, U> Serialize for CornerRadius2D<T, U>where
T: Serialize,
impl<T, U> Serialize for CornerRadius2D<T, U>where
T: Serialize,
impl<T: Copy, U> Copy for CornerRadius2D<T, U>
impl<T: Eq, U> Eq for CornerRadius2D<T, U>
Auto Trait Implementations§
impl<T, U> Freeze for CornerRadius2D<T, U>where
T: Freeze,
impl<T, U> RefUnwindSafe for CornerRadius2D<T, U>where
T: RefUnwindSafe,
U: RefUnwindSafe,
impl<T, U> Send for CornerRadius2D<T, U>
impl<T, U> Sync for CornerRadius2D<T, U>
impl<T, U> Unpin for CornerRadius2D<T, U>
impl<T, U> UnwindSafe for CornerRadius2D<T, U>where
T: UnwindSafe,
U: UnwindSafe,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)