FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    RoundedRect

    struct · ferroui-base · v0.5.0

    struct RoundedRect
    

    Represents a rectangle with per-corner radii.

    View source

    Members

    rect

    rect: crate::Rect
    

    Source

    radii_top_left

    radii_top_left: crate::Vector
    

    Source

    radii_top_right

    radii_top_right: crate::Vector
    

    Source

    radii_bottom_left

    radii_bottom_left: crate::Vector
    

    Source

    radii_bottom_right

    radii_bottom_right: crate::Vector
    

    Source

    new

    const fn new(rect: Rect, radii_top_left: Vector, radii_top_right: Vector, radii_bottom_right: Vector, radii_bottom_left: Vector) -> Self
    

    Initializes a RoundedRect from elliptical corner radii, clockwise from the top left.

    Source

    from_radii

    const fn from_radii(rect: Rect, radius_top_left: f64, radius_top_right: f64, radius_bottom_right: f64, radius_bottom_left: f64) -> Self
    

    Initializes a RoundedRect from circular corner radii, clockwise from the top left.

    Source

    from_uniform_radii

    const fn from_uniform_radii(rect: Rect, radii: Vector) -> Self
    

    Initializes a RoundedRect with the same elliptical radii on every corner.

    Source

    from_radius_xy

    const fn from_radius_xy(rect: Rect, radius_x: f64, radius_y: f64) -> Self
    

    Initializes a RoundedRect with the same X and Y radius on every corner.

    Source

    from_radius

    const fn from_radius(rect: Rect, radius: f64) -> Self
    

    Initializes a RoundedRect with the same circular radius on every corner.

    Source

    from_rect

    const fn from_rect(rect: Rect) -> Self
    

    Initializes a RoundedRect without rounded corners.

    Source

    from_corner_radius

    const fn from_corner_radius(bounds: Rect, radius: CornerRadius) -> Self
    

    Initializes a RoundedRect from bounds and a CornerRadius.

    Source

    equals

    fn equals(self: &Self, other: RoundedRect) -> bool
    

    Source

    is_rounded

    fn is_rounded(self: &Self) -> bool
    

    Gets a value indicating whether any corner has a non-zero radius.

    Source

    is_uniform

    fn is_uniform(self: &Self) -> bool
    

    Gets a value indicating whether all corners have the same radii.

    Source

    inflate

    fn inflate(self: &Self, dx: f64, dy: f64) -> RoundedRect
    

    Source

    deflate

    fn deflate(self: &Self, dx: f64, dy: f64) -> RoundedRect
    

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    This method should be used internally to check for the rect emptiness. Once a dedicated "empty" value exists this is the single place to update.

    Source

    contains_exclusive

    fn contains_exclusive(self: &Self, p: Point) -> bool
    

    Determines whether a point is inside the rounded rectangle, exclusive of the bottom/right edge. Elliptical corners are approximated by circles using the smaller of the two radii.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.