pub struct Radii {
pub top_left: f32,
pub top_right: f32,
pub bottom_right: f32,
pub bottom_left: f32,
}Expand description
How round each corner of a widget’s box is: the radius in logical pixels, 0 for a square corner. When two corners on a side need more than its length, all four shrink by the same factor until they fit, as in CSS, so two on one side never overlap.
Fields§
§top_left: f32The top-left corner.
top_right: f32The top-right corner.
bottom_right: f32The bottom-right corner.
bottom_left: f32The bottom-left corner.
Implementations§
Source§impl Radii
impl Radii
Sourcepub fn fit(&self, width: f32, height: f32) -> Radii
pub fn fit(&self, width: f32, height: f32) -> Radii
These corners on a width by height box, as CSS fits them: a
number that isn’t one, or a negative one, is 0, and when two corners
on a side add up to more than its length, all four are multiplied
by the one factor that makes the tightest side fit. Drawing and
pointer input both use it, so they agree.
Trait Implementations§
impl Copy for Radii
impl StructuralPartialEq for Radii
Auto Trait Implementations§
impl Forget for Radii
impl Freeze for Radii
impl Move for Radii
impl RefUnwindSafe for Radii
impl Send for Radii
impl Sync for Radii
impl Unpin for Radii
impl UnsafeUnpin for Radii
impl UnwindSafe for Radii
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