Pre-1.0: signatures are not frozen. Generated from rustdoc JSON of the compiled crate; rustdoc JSON format version 60. Only public items are listed.
Content-driven layout: containers, flex, wrap, grid, overlay, scroll and
baseline alignment, solved by one deterministic pass over a [Node] tree.
This is a compiled layout pass (pure Rust, no graph kernels): build a tree
with the terse builders, call [Node::solve] with a [TextMeasure] and read
rectangles back by id ([Solved::rect]) or as graph parameters
([Solved::params], LogicalLength literals named prefix.id.x|y|w|h).
Text nodes are measured by the pass itself (see text_measure).
use aster_blueprint::layout::*;
let ui = col().gap(8.).pad(12.).align(Align::Stretch).children([
bx(100., 20.).id("a"),
row().gap(4.).children([bx(30., 10.).id("b"), spacer(), bx(30., 10.).id("c")]).id("r"),
]);
let solved = ui.solve_boxes(200., 100.).unwrap();
assert_eq!(solved.rect("c").unwrap().x, 200. - 12. - 30.);Semantics (all lengths logical, all sizes border-box):
Autosize = natural (content) size;w/h/sizeset it exactly;min/maxclamp.min > maxis refused ([LayoutError::MinExceedsMax]).- Flex: base = natural main size, then
growshares positive free space,shrink(weighted by base) removes overflow, each stopping at min/max. Item min defaults to 0 (no automatic content minimum). Remaining free space is distributed by [Justify]; when items still overflow, they overflow towards the end (justify acts asStart) and the container reports it in [Placed::overflow]. - Cross axis: container [
Align], overridable per child withalign_self/place.Stretchonly affects children whose cross size isAuto.Baselinealigns text/boxes in a row by baseline (elsewhere it isStart). - Wrap: greedy line breaking on the main axis; a wrap container whose width
(documentation continues in the source)
Structs
structaster_blueprint::layout::Anchor
pub struct Anchor { /* see fields */ }Where an anchored child sits inside its parent's padding box. An edge left
None is free; both edges of an axis stretch the child between them.
left / right / top / bottom are physical: they stay where they are
in every direction. start / end are logical: start is the left edge in
a left-to-right subtree and the right edge in a right-to-left one (of the
anchored child's own direction). A physical edge wins over its logical twin.
Public fields
| field | type | |
|---|---|---|
left | Option<Len> | |
top | Option<Len> | |
right | Option<Len> | |
bottom | Option<Len> | |
start | Option<Len> | The inline-start edge (the left in LTR, the right in RTL). |
end | Option<Len> | The inline-end edge (the right in LTR, the left in RTL). |
Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::layout::ContainerFn
pub struct ContainerFn(..)Builds the child of a container query from the container's resolved size (its content box, in logical px).
Trait implementations: Clone, Debug
structaster_blueprint::layout::Deco
pub struct Deco { /* see fields */ }The decoration of a run: lines drawn in the run's colour and a background, none of which touches the layout.
Public fields
| field | type | |
|---|---|---|
underline | bool | |
strike | bool | |
bg | Option<[u8; 4]> | The background behind the run (sRGB, straight alpha). |
Methods
fn is_none(&self) -> bool
Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::layout::Insets
pub struct Insets { /* see fields */ }Safe-area insets (logical px): the edges a display cuts into (a notch, a rounded corner, an overscan border).
Public fields
| field | type | |
|---|---|---|
l | f64 | |
t | f64 | |
r | f64 | |
b | f64 |
Methods
const ZERO: Insets— No insets.fn all(v: f64) -> Self— The same inset on all four sides.const fn new(l: f64, t: f64, r: f64, b: f64) -> Self— Left, top, right, bottom.const fn uniform(v: f64) -> Self— The same inset on all four sides (same as [Insets::all]).fn is_zero(&self) -> bool— Whether every edge is exactly 0.fn horizontal(&self) -> f64— Left and right together.fn vertical(&self) -> f64— Top and bottom together.fn max(self, o: Insets) -> Insets— The edge-wise maximum of two insets.fn sanitized(self) -> Insets— Every edge finite and >= 0 (NaN, infinity and negative values become 0).fn rotated_cw(self) -> Insets— The insets after the surface is turned a quarter turn clockwise (the top edge becomes the right edge, the right the bottom, the bottom the left, the left the top).fn shrink(self, r: Rect) -> Rect— The safe rectangle insider(never smaller than zero).
Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::layout::LenCtx
pub struct LenCtx { /* see fields */ }The environment a layout resolves its lengths against: the viewport, the
device scale, the type scale and the safe area. vw/vh are 0 when the
viewport is unknown; scale is device pixels per logical pixel.
Public fields
| field | type | |
|---|---|---|
vw | f64 | Viewport width in logical px (0 = unknown). |
vh | f64 | Viewport height in logical px (0 = unknown). |
scale | f64 | Device pixels per logical pixel (1 = unscaled). |
em | f64 | The em size (logical px). |
rem | f64 | The rem size (logical px). |
safe | Insets | The safe area (notch, rounded corners, overscan). |
Methods
const fn new(vw: f64, vh: f64, scale: f64, em: f64, rem: f64, safe: Insets) -> Self— A context from its parts.fn with_root(self, rem: f64) -> Self— The same context with a different root font size.fn sanitized(&self) -> LenCtx— The context with every unusable number replaced: a non-finite or negative viewport side becomes 0 (unknown), a non-positive scale 1, a non-finite or negative em / rem 16, a bad inset 0.fn dp_scale(&self) -> f64— The factor that turns a device-independent length into the space the solver works in. The solver works in logical pixels, so it is 1.0; a solver that lays out in device pixels multiplies by [LenCtx::scale].
Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::layout::Node
pub struct Node { /* see fields */ }One layout node. Build with [col], [row], [wrap], [grid],
[overlay], [scroll], [bx], [spacer], [text] and the chained
setters; the first invalid setter is remembered and reported by solve.
Methods
fn id(self, id: &str) -> Selffn size(self, w: f64, h: f64) -> Selffn size_len(self, w: Len, h: Len) -> Self— Width and height as lengths (percentages, viewport units, em...).fn w(self, w: f64) -> Selffn w_len(self, w: Len) -> Self— Width as a length (resolved at layout time).fn h(self, h: f64) -> Selffn h_len(self, h: Len) -> Self— Height as a length (resolved at layout time).fn min_w(self, v: f64) -> Selffn min_h(self, v: f64) -> Selffn max_w(self, v: f64) -> Selffn max_h(self, v: f64) -> Selffn min_w_len(self, v: Len) -> Self— Minimum width as a length.fn min_h_len(self, v: Len) -> Self— Minimum height as a length.fn max_w_len(self, v: Len) -> Self— Maximum width as a length.fn max_h_len(self, v: Len) -> Self— Maximum height as a length.fn grow(self, g: f64) -> Selffn shrink(self, s: f64) -> Selffn min_content(self) -> Self— Opt in: a row never shrinks this child below its min-content width, and a column never makes it narrower than that (the cross-axis floor; the column overflows). The width is (the longest word of a wrapped text, the widest or summed min-content of its children for a container), so a paragraph beside a rigid sibling wraps at words and the row overflows instead of breaking inside a word. In a grid, an overflowing grid shrinks the auto column of a flagged cell down to it. A fixedmin_wstill wins when it is larger.fn basis(self, px: f64) -> Self—flex-basis: the main-axis size (width in a row, height in a column) the flex distribution starts from instead of the content's natural size, sogrowandshrinkshare the space around it.basis(0.)withgrow(1.)splits a row by the weights alone, whatever the content (thew(0.).grow(n)idiom, without fixing the width). Clamped bymin_w/max_was the flex size is; a text wraps at it.fn rigid(self) -> Self— Never shrink (shrink(0)).fn fill(self) -> Self—grow(1)and stretch on both axes (if the sizes areAuto).fn align_content(self, j: Justify) -> Self—align-content: where the lines of a wrapping row/column sit when the container has a definite cross size (Startby default: packed at the start).Center,Endand theSpace*values spread the free cross space over the lines the wayjustifyspreads it over the items.fn align(self, a: Align) -> Self— Container: cross-axis alignment of children (grid/overlay: both axes).fn justify(self, j: Justify) -> Selffn gap(self, g: f64) -> Self— Gap between items (and between wrap lines / grid rows and columns).fn gap_xy(self, gx: f64, gy: f64) -> Self— Horizontal gapgx(between columns) and vertical gapgy(rows).fn gap_len(self, gx: Len, gy: Len) -> Self— Gap as lengths (resolved at layout time).fn pad(self, p: f64) -> Selffn pad_xy(self, x: f64, y: f64) -> Selffn pad4(self, l: f64, t: f64, r: f64, b: f64) -> Self— Left, top, right, bottom.fn pad_len(self, l: Len, t: Len, r: Len, b: Len) -> Self— Padding as lengths: left, top, right, bottom.fn pad_start(self, v: f64) -> Self— The padding on the inline-start edge (the left in LTR, the right in RTL):pad_start(8.).fn pad_end(self, v: f64) -> Self— The padding on the inline-end edge (the right in LTR, the left in RTL):pad_end(8.).fn dir(self, d: Direction) -> Self— The reading direction of this subtree:dir(Direction::Rtl)lays it out right to left. Its descendants inherit it unless they set their own.fn align_self(self, a: Align) -> Self— This child's alignment on the container's cross axis (grid/overlay: both axes).fn place(self, horizontal: Align, vertical: Align) -> Self— This child's horizontal and vertical placement in grid cells / overlays.fn at(self, col: usize, row: usize) -> Self— Grid: explicit cell (column, row).fn span(self, cols: usize, rows: usize) -> Self— Grid: column and row span.fn area(self, name: &str) -> Self— Grid: the named area this child sits in (see [Node::areas]).fn maximize_tracks(self) -> Self— Grid: the named-area template, one string per row ("head head"). A.leaves the cell empty. The rows must all have the same number of Grid: letminmaxtracks absorb the free space up to their maximum (see the foundation docs).- ...and 25 more
Trait implementations: Clone, Debug
structaster_blueprint::layout::Placed
pub struct Placed { /* see fields */ }A solved node in absolute coordinates (root origin = viewport origin).
Public fields
| field | type | |
|---|---|---|
id | Option<String> | |
tag | Tag | |
rect | Rect | |
dir | Direction | The direction of this node (its own, or the one it inherits). |
baseline | f64 | Absolute y of the first baseline. |
clip | Option<Rect> | Visible region inherited from enclosing scroll containers. |
overflow | [f64; 2] | How far children extend past the content box (main/cross as x/y). |
scroll | Option<ScrollInfo> | |
text | Option<(String, f64, String, text_measure::TextMetrics)> | |
lines | Vec<TextLine> | Text nodes: the broken lines in absolute coordinates (one entry for single-line text). text's metrics carry the widest line width. |
rich | Option<Box<Vec<TextPiece>>> | Rich text nodes: the face-runs of every line, in absolute coordinates (one entry per line and run). None for a plain text. |
children | Vec<Placed> |
Methods
fn find(&self, id: &str) -> Option<&Placed>fn walk<'a>(&self, f: &mut impl FnMut(&'a Placed))— Depth-first, parents before children, in tree order.
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::layout::Rect
pub struct Rect { /* see fields */ }Public fields
| field | type | |
|---|---|---|
x | f64 | |
y | f64 | |
w | f64 | |
h | f64 |
Methods
fn right(self) -> f64fn bottom(self) -> f64fn to_logical(self) -> Result<aster_ui::LogicalRect, aster_ui::Error>fn intersect(self, o: Rect) -> Rect
Trait implementations: Clone, Copy, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::layout::ScrollInfo
pub struct ScrollInfo { /* see fields */ }Public fields
| field | type | |
|---|---|---|
offset | [f64; 2] | Applied (clamped) offset. |
max_offset | [f64; 2] | Largest useful offset per axis (content - viewport, at least 0). |
content | [f64; 2] | Content size. |
view | [f64; 2] | Viewport size (the visible part of the content at an offset). |
rtl | bool | The container sits in a right-to-left subtree: the horizontal offset is measured from the right edge (0 shows the right end of the content, a larger offset reveals the left). |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::layout::Solved
pub struct Solved { /* see fields */ }Public fields
| field | type | |
|---|---|---|
root | Placed |
Methods
fn get(&self, id: &str) -> Option<&Placed>fn rect(&self, id: &str) -> Option<Rect>fn params(&self, prefix: &str) -> Result<Vec<(Symbol, Literal)>, LayoutError>—LogicalLengthgraph parametersprefix.id.x|y|w|hfor every node with an id (tree order), so graph nodes consume solved geometry.
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::layout::Span
pub struct Span { /* see fields */ }One inline run of a rich paragraph.
Public fields
| field | type | |
|---|---|---|
text | String | The text of the run. |
font | String | The face of the run (the node's own face when it is empty). |
size | f64 | The size of the run (the node's own size when it is zero). |
color | Option<[u8; 4]> | The colour of the run (the node's own colour when it is none). |
dir | Option<layout::Direction> | The run is a directional isolate of this direction (None: it reads in the paragraph's flow). |
deco | Deco | The lines and background drawn with the run. |
Methods
fn new(text: impl Into<String>) -> Span— A run oftextin the node's own face, size and colour.fn deco(self, deco: Deco) -> Span— Draw the run underlined, struck through or on a background.fn dir(self, dir: Direction) -> Span— Make the run a directional isolate (UAX #9 LRI / RLI): it is resolved indiron its own, as one neutral object of the paragraph around it, so a Hebrew name in an English sentence (or the other way round) does not pull the punctuation next to it into its direction.fn font(self, f: impl Into<String>) -> Span— The face of the run (the node's own face when it is empty;"bold"is the bold face of the UI theme).fn bold(self) -> Span— The bold face of the run.fn size(self, s: f64) -> Span— The size of the run (px).fn color(self, c: [u8; 4]) -> Span— The colour of the run (sRGB, straight alpha).
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::layout::TextLine
pub struct TextLine { /* see fields */ }One laid-out line of a text node.
Public fields
| field | type | |
|---|---|---|
text | String | |
x | f64 | Left edge of the glyph box (absolute). |
y | f64 | Top of the glyph box (absolute); its height is the font height. |
w | f64 | Measured width. |
baseline | f64 | Absolute baseline y. |
dir | Direction | The base direction of the line's \n paragraph (the first strong character decides). |
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::layout::TextPiece
pub struct TextPiece { /* see fields */ }One drawn piece of a rich text line: a run of text in one face, size and colour.
Public fields
| field | type | |
|---|---|---|
text | String | The text of the piece. |
font | String | The face of the piece. |
size | f64 | The size of the piece. |
color | Option<[u8; 4]> | The colour of the piece (the element's own colour when it is none). |
level | u8 | The bidi level of the piece: odd is shaped right to left ([crate::bidi]). |
x | f64 | Left edge of the glyph box (absolute). |
y | f64 | Top of the glyph box (absolute); its height is the face's height. |
w | f64 | Measured width. |
h | f64 | The height of the face (ascent + descent + gap). |
baseline | f64 | Absolute baseline y (the runs of a line share it). |
line | [f64; 2] | Absolute top and height of the whole line the piece sits on (a background fills it). |
deco | rich_text::Deco | The lines and background drawn with the piece. |
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::layout::WrapOpts
pub struct WrapOpts { /* see fields */ }The wrap options of one text node.
Public fields
| field | type | |
|---|---|---|
rules | WrapRules | The break opportunities the breaker may use. |
mode | WrapMode | How the breaker places the breaks. |
Methods
const fn new(rules: WrapRules, mode: WrapMode) -> Self— The options of one mode and one rule set.
Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq
Enums
enumaster_blueprint::layout::Align
pub enum Align { Start, Center, End, Stretch, Baseline }Variants
StartCenterEndStretchBaseline
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::Direction
pub enum Direction { Ltr, Rtl }The reading direction of a subtree: left-to-right (the default) or
right-to-left. A node inherits the direction of its parent unless it sets
its own (see [Node::dir]).
In a right-to-left subtree the children of a container are placed from the
right edge to the left, Start is the right edge and End the left one,
the columns of a grid run right to left, a horizontal scroll starts at the
right and the text of a line is aligned to the right when it is Start.
Methods
fn is_rtl(self) -> bool— Whether this is right-to-left.fn flipped(self) -> Self— The other direction.
Variants
LtrRtl
Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::Justify
pub enum Justify { Start, Center, End, SpaceBetween, SpaceAround, SpaceEvenly }Variants
StartCenterEndSpaceBetweenSpaceAroundSpaceEvenly
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::LayoutError
pub enum LayoutError { Invalid, MinExceedsMax, DuplicateId, Structure, TooLarge, NoTextMeasurer, NativeFontsRequired, UnknownFont, Text }Variants
Invalid— A non-finite, negative or otherwise unusable value.MinExceedsMax—min > maxon axis 0 (width) or 1 (height).DuplicateIdStructure— Structural error (grid cell out of range / occupied, scroll without exactly one child, empty grid columns...).TooLargeNoTextMeasurer— A text node was solved with no measurer (see [NoText]).NativeFontsRequired— Real text measurement requires thenative-fontsfeature.UnknownFontText— An aster-ui text error, rendered withDebug.
Trait implementations: Clone, Debug, Display, Error, From<LayoutError>, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::Len
pub enum Len { Px, Dp, Pct, Vw, Vh, Vmin, Vmax, Em, Rem, Fr, Clamp, Min, Max }A length with a unit, resolved at layout time against a [LenCtx] and the
parent's content box (percentages). The f64 setters of [Node] mean
[Len::Px].
Methods
fn clamp(min: Len, preferred: Len, max: Len) -> Len— CSSclamp(min, preferred, max): the preferred length held between the two bounds. Resolved at layout time, so the bounds may use any unit.fn min(a: Len, b: Len) -> Len— The smaller of two lengths (resolved at layout time).fn max(a: Len, b: Len) -> Len— The larger of two lengths (resolved at layout time).fn is_px(&self) -> bool— Whether the length is plain logical pixels.fn has_fr(&self) -> bool— Whether the length holds anfr(valid only in a grid track).fn has_pct(&self) -> bool— Whether the length depends on the percentage basis.fn resolve_opt(&self, basis: Option<f64>, ctx: &LenCtx) -> Option<f64>— The length in logical px, orNonewhen it cannot be known: a percentage of an indefinitebasis, or a viewport unit while the viewport is unknown (vw/vh= 0).basisis the percentage basis: the parent's content box on the axis the length is used on. Aclampwhose bounds cross lets the minimum win, like CSS.fn resolve(&self, basis: f64, ctx: &LenCtx) -> f64— The length in logical px against a definitebasis; an unknown length (see [Len::resolve_opt]) is 0.
Variants
Px— Logical pixels.Dp— Device-independent pixels: 1 dp is 1 logical px in the logical solver.Pct— Percent of the parent's content box on that axis.Vw— Percent of the viewport width.Vh— Percent of the viewport height.Vmin— Percent of the smaller viewport side.Vmax— Percent of the larger viewport side.Em— Multiples of the context's em.Rem— Multiples of the context's rem.Fr— A share of the free space (grid tracks only).Clamp—clamp(min, preferred, max).Min— The smaller of two lengths.Max— The larger of two lengths.
Trait implementations: Clone, Debug, From<f64>, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::Repeat
pub enum Repeat { AutoFill, AutoFit }How a repeat() fills its tracks: AutoFill keeps the empty ones,
AutoFit collapses them and lets the rest grow into the free space.
Variants
AutoFillAutoFit
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::ScrollAxis
pub enum ScrollAxis { Vertical, Horizontal, Both }Variants
VerticalHorizontalBoth
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::Tag
pub enum Tag { Box, Text, Row, Column, Wrap, Grid, Overlay, Scroll, Container, Safe }Tag of a solved node.
Variants
BoxTextRowColumnWrapGridOverlayScrollContainer— A container query (its child is built from its own size).Safe— A safe-area wrapper.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::TextAlign
pub enum TextAlign { Start, Center, End }Horizontal alignment of each line of a multi-line text within its box.
Variants
StartCenterEnd
Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::Track
pub enum Track { Px, Fr, Auto, Minmax, Repeat }A grid track: a fixed size, a share of the free space, a content size, a
minmax(min, max) bound or a repeat(auto-fill | auto-fit, track) run.
Variants
PxFrAutoMinmax—minmax(min, max): at leastmin, at mostmax. AFrmax shares the free space; any other max is a hard limit.Repeat—repeat(auto-fill | auto-fit, track): the track repeats as often as fits.
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::WrapMode
pub enum WrapMode { Greedy, Balance, Pretty }How the line breaker places the breaks.
Variants
Greedy— Greedy: every line takes as much as fits (the default).Balance— Balance: keep the line count and narrow the lines to the narrowest width that still fits them (for headings and titles).Pretty— Pretty: keep the line count and re-break the tail so the last line is not a short orphan.
Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::layout::WrapRules
pub enum WrapRules { Ascii, Unicode }Which break opportunities the line breaker may use.
Variants
Ascii— ASCII spaces only: the classic greedy wrap (the default).Unicode— A pragmatic subset of UAX #14: after hyphens, en and em dashes, after the slashes of a URL or a path, at every CJK boundary (never before a closing punctuation), at a zero width space (U+200B) and at a soft hyphen (U+00AD, which shows a hyphen when the line breaks there). A no-break space (U+00A0) and a word joiner (U+2060) are non-breaks.
Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq
Functions
fnaster_blueprint::layout::aspect_box
pub fn aspect_box(ratio: f64) -> NodeA leaf with no size and a width / height ratio: the free axis follows the other one.
fnaster_blueprint::layout::auto_box
pub fn auto_box() -> NodeA leaf with no size: it takes the size its parent gives it (a grid cell, a stretched flex item).
fnaster_blueprint::layout::bx
pub fn bx(w: f64, h: f64) -> NodeA leaf with an exact size.
fnaster_blueprint::layout::col
pub fn col() -> NodeVertical stack.
fnaster_blueprint::layout::container
pub fn container(f: impl Fn(f64, f64) -> Node + 'static) -> NodeA container query: the child is built from the container's own resolved size (its content box, in logical px). The container needs a definite size on the axes it queries; an indefinite axis queries 0.
fnaster_blueprint::layout::grid
pub fn grid(cols: impl IntoIterator<Item = Track>, rows: impl IntoIterator<Item = Track>) -> NodeGrid with column and row tracks (rows are extended with Auto as needed).
fnaster_blueprint::layout::grid_cols
pub fn grid_cols(n: usize) -> Noden equal 1fr columns.
fnaster_blueprint::layout::overlay
pub fn overlay() -> NodeChildren stacked on top of each other in the same box (later = on top).
Children with an Auto size fill the box by default (Align::Stretch);
use .place(h, v) / .align_self(..) on a child, or .align(..) on the
overlay, to position them instead.
fnaster_blueprint::layout::paragraph
pub fn paragraph(font: &str, size: f64, text: &str) -> NodeA word-wrapping text leaf: breaks at spaces to the width it is given
(explicit \n always breaks; over-long words break between characters).
Same as text(..).wrapped(). Its height follows its solved width.
fnaster_blueprint::layout::rich
pub fn rich(font: &str, size: f64, spans: impl IntoIterator<Item = Span>) -> NodeA rich text leaf: the inline runs of one paragraph, laid out as one text
(the lines break across the runs, the runs of a line share one baseline).
The runs that do not name their own face and size take font and size.
fnaster_blueprint::layout::row
pub fn row() -> NodeHorizontal stack.
fnaster_blueprint::layout::safe_area
pub fn safe_area(child: Node) -> NodeA wrapper that keeps its child inside the safe area (the context's insets).
fnaster_blueprint::layout::scroll
pub fn scroll(child: Node) -> NodeClip + offset container around one child.
fnaster_blueprint::layout::spacer
pub fn spacer() -> NodeAn empty flexible gap (grow = 1).
fnaster_blueprint::layout::span
pub fn span(text: impl Into<String>) -> SpanA run of text in the node's own face, size and colour.
fnaster_blueprint::layout::text
pub fn text(font: &str, size: f64, text: &str) -> NodeA single-line text leaf, measured by the layout pass.
fnaster_blueprint::layout::wrap
pub fn wrap() -> NodeHorizontal stack that wraps onto new lines.
fnaster_blueprint::layout::wrap_col
pub fn wrap_col() -> NodeVertical stack that wraps onto new columns (needs a definite height).
Constants
constaster_blueprint::layout::MAX_COORD
pub const MAX_COORD: f64constaster_blueprint::layout::MAX_DEPTH
pub const MAX_DEPTH: usizeconstaster_blueprint::layout::MAX_NODES
pub const MAX_NODES: usizeLargest node count / depth / coordinate magnitude a layout accepts.