pub struct Radius {
pub tl: f32,
pub tr: f32,
pub br: f32,
pub bl: f32,
}Expand description
Per-corner border radius in logical pixels.
§Examples
use ailloli_ui_core::Radius;
assert_eq!(Radius::uniform(4.0), Radius { tl: 4.0, tr: 4.0, br: 4.0, bl: 4.0 });Fields§
§tl: f32Top-left radius in logical pixels.
tr: f32Top-right radius in logical pixels.
br: f32Bottom-right radius in logical pixels.
bl: f32Bottom-left radius in logical pixels.
Implementations§
Source§impl Radius
impl Radius
Sourcepub const fn zero() -> Self
pub const fn zero() -> Self
Zero radius on all corners.
§Examples
use ailloli_ui_core::Radius;
assert_eq!(Radius::zero(), Radius::uniform(0.0));Sourcepub const fn uniform(v: f32) -> Self
pub const fn uniform(v: f32) -> Self
Stores the same radius on all corners without clamping it.
§Examples
use ailloli_ui_core::Radius;
assert_eq!(Radius::uniform(3.0).br, 3.0);Sourcepub const fn per_corner(tl: f32, tr: f32, br: f32, bl: f32) -> Self
pub const fn per_corner(tl: f32, tr: f32, br: f32, bl: f32) -> Self
Stores independent radii in clockwise order from top-left.
Negative and non-finite values are preserved for later geometry/render normalization.
§Examples
use ailloli_ui_core::Radius;
assert_eq!(Radius::per_corner(1.0, 2.0, 3.0, 4.0).bl, 4.0);Trait Implementations§
impl Copy for Radius
impl StructuralPartialEq for Radius
Auto Trait Implementations§
impl Freeze for Radius
impl RefUnwindSafe for Radius
impl Send for Radius
impl Sync for Radius
impl Unpin for Radius
impl UnwindSafe for Radius
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