FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    RoundedRectKeypoints

    struct · ferroui-base · v0.5.0

    struct RoundedRectKeypoints
    

    Represents the keypoints of a rounded rectangle. These keypoints can be shared between methods and turned into geometry.

    A rounded rectangle is the base geometric shape used when drawing borders. It is a superset of a simple rectangle (which has corner radii set to zero). These keypoints can be combined together to produce geometries for both background and border elements.

    View source

    Members

    left_top

    left_top: crate::Point
    

    The topmost point in the left line segment of the rectangle.

    Source

    top_left

    top_left: crate::Point
    

    The leftmost point in the top line segment of the rectangle.

    Source

    top_right

    top_right: crate::Point
    

    The rightmost point in the top line segment of the rectangle.

    Source

    right_top

    right_top: crate::Point
    

    The topmost point in the right line segment of the rectangle.

    Source

    right_bottom

    right_bottom: crate::Point
    

    The bottommost point in the right line segment of the rectangle.

    Source

    bottom_right

    bottom_right: crate::Point
    

    The rightmost point in the bottom line segment of the rectangle.

    Source

    bottom_left

    bottom_left: crate::Point
    

    The leftmost point in the bottom line segment of the rectangle.

    Source

    left_bottom

    left_bottom: crate::Point
    

    The bottommost point in the left line segment of the rectangle.

    Source

    new

    fn new() -> Self
    

    Initializes a new instance of the RoundedRectKeypoints struct.

    Source

    from_rounded_rect

    fn from_rounded_rect(rounded_rect: RoundedRect) -> Self
    

    Initializes a new instance of the RoundedRectKeypoints struct.

    • rounded_rect - An existing RoundedRect to initialize keypoints with.

    Source

    is_rounded

    fn is_rounded(self: &Self) -> bool
    

    Gets a value indicating whether the rounded rectangle is actually rounded on any corner. If false the key points represent a simple rectangle.

    Source

    to_rect

    fn to_rect(self: &Self) -> Rect
    

    Converts the keypoints into a simple rectangle (with no corners). This is equivalent to the outer rectangle with zero corner radii.

    Warning: This will force the keypoints into a simple rectangle without any rounded corners. Use is_rounded to determine if corner information is otherwise available.

    Source

    to_rounded_rect

    fn to_rounded_rect(self: &Self) -> RoundedRect
    

    Converts the keypoints into a rounded rectangle with elliptical corner radii.

    Elliptical corner radius (represented by Vector) is more powerful than circular corner radius (represented by a CornerRadius). Elliptical is a superset of circular.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default

    Availability

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