FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    GeometryBuilder

    struct · ferroui-base · v0.5.0

    struct GeometryBuilder
    

    Contains internal helpers used to build and draw various geometries.

    View source

    Members

    draw_rounded_corners_rectangle_keypoints

    fn draw_rounded_corners_rectangle_keypoints(context: &mut StreamGeometryContext, keypoints: &RoundedRectKeypoints)
    

    Draws a new rounded rectangle within the given geometry context. Warning: The caller must manage and dispose the StreamGeometryContext externally.

    WinUI: https://github.com/microsoft/microsoft-ui-xaml/blob/93742a178db8f625ba9299f62c21f656e0b195ad/dxaml/xcp/core/core/elements/geometry.cpp#L1072-L1079

    • context - The geometry context to draw into.
    • keypoints - The rounded rectangle keypoints defining the rectangle to draw.

    Source

    calculate_rounded_corners_rectangle_win_ui

    fn calculate_rounded_corners_rectangle_win_ui(outer_bounds: Rect, border_thickness: Thickness, corner_radius: CornerRadius, sizing: BackgroundSizing) -> RoundedRectKeypoints
    

    Calculates the keypoints of a rounded rectangle based on the algorithm in WinUI. These keypoints may then be drawn or transformed into other types.

    • outer_bounds - The outer bounds of the rounded rectangle. This should be the overall bounds and size of the shape/control without any corner radii or border thickness adjustments.
    • border_thickness - The unadjusted border thickness of the rounded rectangle.
    • corner_radius - The unadjusted corner radii of the rounded rectangle. The corner radius is defined to be the middle of the border stroke (center of the border).
    • sizing - The sizing mode used to calculate the final rounded rectangle size.

    Returns new rounded rectangle keypoints.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ErasedDestructor
    • IntoEither

    Availability

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