FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ObstacleLayoutHelper

    struct · ferroui-pretext-layout · v0.5.0

    struct ObstacleLayoutHelper
    

    Geometry utilities for carving horizontal text slots from exclusion shapes.

    View source

    Members

    carve_text_line_slots

    fn carve_text_line_slots(base_slot: Interval, blocked: impl IntoIterator<Item = Interval>, min_slot_width: f64) -> Vec<Interval>
    

    Carve all blocked intervals, then discard slots narrower than the minimum. The surviving intervals remain ordered from left to right.

    Source

    circle_interval_for_band

    fn circle_interval_for_band(cx: f64, cy: f64, radius: f64, band_top: f64, band_bottom: f64, horizontal_padding: f64, vertical_padding: f64) -> Option<Interval>
    

    The widest horizontal intersection of a circle with the entire line band. A tangent band has no occupied area and yields None.

    Source

    ellipse_interval_for_band

    fn ellipse_interval_for_band(cx: f64, cy: f64, radius_x: f64, radius_y: f64, band_top: f64, band_bottom: f64, horizontal_padding: f64, vertical_padding: f64) -> Option<Interval>
    

    Source

    get_rect_intervals_for_band

    fn get_rect_intervals_for_band(rects: &[RectObstacle], band_top: f64, band_bottom: f64, horizontal_padding: f64, vertical_padding: f64) -> Vec<Interval>
    

    Source

    pick_slot

    fn pick_slot(slots: &[Interval], prefer_right_on_tie: bool) -> Option<Interval>
    

    Pick the widest usable slot and resolve equal widths by horizontal order. Empty inputs return None instead of indexing an absent first interval.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • 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.