pub struct Layout {
pub columns: u32,
pub rows: u32,
pub unit: f32,
pub placements: Vec<Placement>,
pub groups: Vec<GroupPlacement>,
}Expand description
A laid-out container.
Fields§
§columns: u32The grid’s width in twelfths (its column count).
rows: u32The height used, in twelfths.
unit: f32The unit, in points, the layout was made with.
placements: Vec<Placement>One placement per element, in logical order.
groups: Vec<GroupPlacement>One per group, in the order given.
Implementations§
Source§impl Layout
impl Layout
Sourcepub fn dump(&self) -> String
pub fn dump(&self) -> String
Draws the layout as an ASCII grid, then lists every element.
Each element is drawn with a letter for its logical index (a is the
first), empty room with .. One character spans the largest number
of twelfths that divides every edge, so a grid of whole rows prints
one line per row. The list gives, in logical order, the form, the
orientation, the slot in twelfths and the status.
With groups, a gutter left of the picture draws each group’s band,
one column per nesting depth (/ its first line, | the middle
ones, \\ its last, [ a one-line group), and one line per group
precedes the elements’ list: its key, its parent’s, its band and
the row its members start at.
Source§impl Layout
impl Layout
Sourcepub fn visual_order(&self) -> Vec<&Placement>
pub fn visual_order(&self) -> Vec<&Placement>
The placed elements in visual order.
Sourcepub fn group(&self, key: u64) -> Option<&GroupPlacement>
pub fn group(&self, key: u64) -> Option<&GroupPlacement>
The placement of the group with this key.
Sourcepub fn height_points(&self) -> f32
pub fn height_points(&self) -> f32
The height used, in points.