pub struct CornerShape(pub f32);Expand description
CSS corner-shape: the superellipse parameter K of superellipse(K) (css-borders-4 §3.7).
The corner is x^(2^K) + y^(2^K) = 1, mirrored about the corner when K is negative.
Tuple Fields§
§0: f32Implementations§
Source§impl CornerShape
impl CornerShape
Sourcepub fn half_corner(self) -> f32
pub fn half_corner(self) -> f32
The normalized superellipse half corner (§3.9.6): where the curve crosses the corner’s
diagonal, from 0 (notch) through 0.5 (bevel) to 1 (square).
Sourcepub fn from_half_corner(value: f32) -> Self
pub fn from_half_corner(value: f32) -> Self
The shape whose CornerShape::half_corner is value.
Sourcepub fn interpolate(self, to: Self, t: f32) -> Self
pub fn interpolate(self, to: Self, t: f32) -> Self
CSS interpolation: the half corner moves linearly (§3.9.6).
Trait Implementations§
Source§impl Clone for CornerShape
impl Clone for CornerShape
impl Copy for CornerShape
Source§impl Debug for CornerShape
impl Debug for CornerShape
Source§impl Default for CornerShape
impl Default for CornerShape
Source§impl<'de> Deserialize<'de> for CornerShape
impl<'de> Deserialize<'de> for CornerShape
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 PartialEq for CornerShape
impl PartialEq for CornerShape
Source§impl Serialize for CornerShape
impl Serialize for CornerShape
impl StructuralPartialEq for CornerShape
Auto Trait Implementations§
impl Forget for CornerShape
impl Freeze for CornerShape
impl Move for CornerShape
impl RefUnwindSafe for CornerShape
impl Send for CornerShape
impl Sync for CornerShape
impl Unpin for CornerShape
impl UnsafeUnpin for CornerShape
impl UnwindSafe for CornerShape
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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