pub struct CornerRounding {
pub radius: f64,
pub smoothing: f64,
}Expand description
How much, and how smoothly, a single vertex is rounded.
A corner is one of three things:
- unrounded —
CornerRounding::UNROUNDED, the vertex itself; - circular —
smoothing == 0: one arc between the two adjacent edges; - smoothed —
smoothing > 0: an inner arc plus two symmetric flanking curves carrying the arc out to the edges. Atsmoothing == 1there is no arc left at all — the flanking curves meet in the middle.
radius is an absolute length in the polygon’s own coordinate space, so a
shape authored in the canonical (-1, -1)..(1, 1) box wants radii relative
to that box, not to its eventual on-screen size. Transforming the polygon
scales the rounding with it.
Fields§
§radius: f64Radius of the circle defining the corner’s inner arc; 0 is a sharp
corner.
smoothing: f64How far the arc is extended toward the adjacent edges, in 0..=1.
Implementations§
Source§impl CornerRounding
impl CornerRounding
Sourcepub const UNROUNDED: CornerRounding
pub const UNROUNDED: CornerRounding
A sharp corner: the vertex itself, no arc.
Sourcepub fn radius(radius: f64) -> CornerRounding
pub fn radius(radius: f64) -> CornerRounding
Trait Implementations§
Source§impl Clone for CornerRounding
impl Clone for CornerRounding
impl Copy for CornerRounding
Source§impl Debug for CornerRounding
impl Debug for CornerRounding
Source§impl Default for CornerRounding
impl Default for CornerRounding
Source§impl PartialEq for CornerRounding
impl PartialEq for CornerRounding
impl StructuralPartialEq for CornerRounding
Auto Trait Implementations§
impl Freeze for CornerRounding
impl RefUnwindSafe for CornerRounding
impl Send for CornerRounding
impl Sync for CornerRounding
impl Unpin for CornerRounding
impl UnsafeUnpin for CornerRounding
impl UnwindSafe for CornerRounding
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<T> Brush for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.