#[repr(C)]pub struct CornerShapes {
pub top_left: u32,
pub top_right: u32,
pub bottom_right: u32,
pub bottom_left: u32,
}Expand description
The corner shapes of a primitive as the shaders read them. Each corner’s word holds the
shape’s half corner in its low 12 bits, 0 for round, then two 10-bit insets in quarter
pixels: the corner is the inner edge of a border that wide on the box bounds is inside.
Fields§
§top_left: u32The top left corner.
top_right: u32The top right corner.
bottom_right: u32The bottom right corner.
bottom_left: u32The bottom left corner.
Implementations§
Source§impl CornerShapes
impl CornerShapes
Sourcepub fn new(shapes: &Corners<CornerShape>) -> Self
pub fn new(shapes: &Corners<CornerShape>) -> Self
Each corner’s shape, without insets.
Sourcepub fn is_round(&self) -> bool
pub fn is_round(&self) -> bool
Whether every corner is round, the shape the shaders draw without these.
Sourcepub fn with_insets(self, insets: Corners<(f32, f32)>) -> Self
pub fn with_insets(self, insets: Corners<(f32, f32)>) -> Self
The shapes as the inner edge of a border insets wide on each axis, per corner
(x: the left or right border, y: the top or bottom one). A round corner takes none.
Sourcepub fn without_insets(self) -> Self
pub fn without_insets(self) -> Self
The same shapes without insets.
Trait Implementations§
Source§impl Clone for CornerShapes
impl Clone for CornerShapes
impl Copy for CornerShapes
Source§impl Debug for CornerShapes
impl Debug for CornerShapes
Source§impl Default for CornerShapes
impl Default for CornerShapes
impl Eq for CornerShapes
Source§impl Hash for CornerShapes
impl Hash for CornerShapes
Source§impl PartialEq for CornerShapes
impl PartialEq for CornerShapes
impl StructuralPartialEq for CornerShapes
Auto Trait Implementations§
impl Forget for CornerShapes
impl Freeze for CornerShapes
impl Move for CornerShapes
impl RefUnwindSafe for CornerShapes
impl Send for CornerShapes
impl Sync for CornerShapes
impl Unpin for CornerShapes
impl UnsafeUnpin for CornerShapes
impl UnwindSafe for CornerShapes
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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