Skip to main content

Module layout

Module layout 

Source

Structs§

LayoutNode
Rect

Enums§

Align
FlexDir

Constants§

MIN_KNOB_H
Shortest a scrollbar knob gets.
SCROLLBAR_W
Width of the strip a scrollbar container reserves on its right edge.

Functions§

compute
Compute layout starting at (0,0) with given available size. Returns the root LayoutNode with absolute coordinates.
find_by_id
Find the resolved rect of the (first) node tagged id (see Widget::id). Meant for baking a widget tree’s computed positions into some other system at “measure time” (e.g. a mod reporting real-slot pixel offsets to its host) — a WinForms-style measure-then-use pass, not a per-frame call.
find_node
The (first) node tagged id — its rect plus scrolling state (LayoutNode::scroll_y, LayoutNode::scrollbar_rects, …).
hit_test
Hit-test: find deepest clickable, enabled node at (mx, my). Children only count where they’re inside their parent’s rect, so rows scrolled out of a clipping container can’t be clicked.
set_focus
Walk tree and set focused = true on the node whose id matches, false on all others.