ObstacleLayoutHelper
struct · ferroui-pretext-layout · v0.5.0
struct ObstacleLayoutHelper
Geometry utilities for carving horizontal text slots from exclusion shapes.
Members
carve_text_line_slotscircle_interval_for_bandellipse_interval_for_bandget_rect_intervals_for_bandpick_slot
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.
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.
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>
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>
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.