pub struct CornerRadius {
pub top_left: f64,
pub top_right: f64,
pub bottom_right: f64,
pub bottom_left: f64,
}Expand description
Represents the radii of a rectangle’s corners.
Fields§
§top_left: f64Radius of the top left corner.
top_right: f64Radius of the top right corner.
bottom_right: f64Radius of the bottom right corner.
bottom_left: f64Radius of the bottom left corner.
Implementations§
Source§impl CornerRadius
impl CornerRadius
Sourcepub const fn new(
top_left: f64,
top_right: f64,
bottom_right: f64,
bottom_left: f64,
) -> Self
pub const fn new( top_left: f64, top_right: f64, bottom_right: f64, bottom_left: f64, ) -> Self
Initializes a CornerRadius from the four corner radii, clockwise from the top left.
Sourcepub const fn uniform(uniform_radius: f64) -> Self
pub const fn uniform(uniform_radius: f64) -> Self
Initializes a CornerRadius with the same radius on every corner.
Sourcepub const fn top_bottom(top: f64, bottom: f64) -> Self
pub const fn top_bottom(top: f64, bottom: f64) -> Self
Initializes a CornerRadius from the radius of the top corners and the
radius of the bottom corners.
Sourcepub fn is_uniform(&self) -> bool
pub fn is_uniform(&self) -> bool
Gets a value indicating whether the instance has equal values for all corners (NaN compares equal to NaN here).
Sourcepub fn equals(&self, other: CornerRadius) -> bool
pub fn equals(&self, other: CornerRadius) -> bool
Returns a boolean indicating whether the corner radius is equal to the other given corner radius (exact comparison).
Sourcepub fn parse(s: &str) -> Result<Self, FormatError>
pub fn parse(s: &str) -> Result<Self, FormatError>
Parses a CornerRadius string: one, two or four numbers.
Trait Implementations§
Source§impl BatchValue for CornerRadius
impl BatchValue for CornerRadius
Source§impl Clone for CornerRadius
impl Clone for CornerRadius
impl Copy for CornerRadius
Source§impl Debug for CornerRadius
impl Debug for CornerRadius
Source§impl Default for CornerRadius
impl Default for CornerRadius
Source§impl Display for CornerRadius
impl Display for CornerRadius
Source§impl FromStr for CornerRadius
impl FromStr for CornerRadius
Source§impl MarkupTyped for CornerRadius
impl MarkupTyped for CornerRadius
Source§const MARKUP: &'static MarkupType
const MARKUP: &'static MarkupType
The markup metadata of the type.
Source§impl PartialEq for CornerRadius
impl PartialEq for CornerRadius
Source§impl ServerPropertyValue for CornerRadius
impl ServerPropertyValue for CornerRadius
impl StructuralPartialEq for CornerRadius
Source§impl Transition<CornerRadius> for CornerRadiusTransition
impl Transition<CornerRadius> for CornerRadiusTransition
Source§fn do_transition(
this: &Self,
progress: Rc<dyn IObservable<f64>>,
old_value: CornerRadius,
new_value: CornerRadius,
) -> Rc<dyn IObservable<CornerRadius>>
fn do_transition( this: &Self, progress: Rc<dyn IObservable<f64>>, old_value: CornerRadius, new_value: CornerRadius, ) -> Rc<dyn IObservable<CornerRadius>>
Creates the observable of the values of the transition from
old_value to new_value, driven by progress (from 0 to 1).Auto Trait Implementations§
impl Freeze for CornerRadius
impl RefUnwindSafe for CornerRadius
impl Send for CornerRadius
impl Sync for CornerRadius
impl Unpin for CornerRadius
impl UnsafeUnpin for CornerRadius
impl UnwindSafe for CornerRadius
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more