diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-06-13 23:16:40 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-06-14 13:53:02 +0200 |
| commit | c81e2a5f56eb262663f292578c683fba7f18251f (patch) | |
| tree | 6c045a8dcbec5e75e01a15f970ef8cee6ff042d0 /src/library/layout | |
| parent | 891af17260a6750a74a102388a05e59cf1ffc3c1 (diff) | |
Many fixes
Diffstat (limited to 'src/library/layout')
| -rw-r--r-- | src/library/layout/columns.rs | 2 | ||||
| -rw-r--r-- | src/library/layout/grid.rs | 2 | ||||
| -rw-r--r-- | src/library/layout/pad.rs | 2 | ||||
| -rw-r--r-- | src/library/layout/page.rs | 2 | ||||
| -rw-r--r-- | src/library/layout/place.rs | 3 | ||||
| -rw-r--r-- | src/library/layout/stack.rs | 3 |
6 files changed, 7 insertions, 7 deletions
diff --git a/src/library/layout/columns.rs b/src/library/layout/columns.rs index 33ceab86..efc435aa 100644 --- a/src/library/layout/columns.rs +++ b/src/library/layout/columns.rs @@ -58,10 +58,10 @@ impl Layout for ColumnsNode { // Layout the children. let mut frames = self.child.layout(ctx, &pod, styles)?.into_iter(); + let mut finished = vec![]; let dir = styles.get(TextNode::DIR); let total_regions = (frames.len() as f32 / columns as f32).ceil() as usize; - let mut finished = vec![]; // Stitch together the columns for each region. for region in regions.iter().take(total_regions) { diff --git a/src/library/layout/grid.rs b/src/library/layout/grid.rs index c02662a6..5e86f3d0 100644 --- a/src/library/layout/grid.rs +++ b/src/library/layout/grid.rs @@ -67,7 +67,7 @@ pub enum TrackSizing { castable! { Vec<TrackSizing>, - Expected: "integer, auto, relative length, fraction, or array of the latter three)", + Expected: "integer, auto, relative length, fraction, or array of the latter three", Value::Auto => vec![TrackSizing::Auto], Value::Length(v) => vec![TrackSizing::Relative(v.into())], Value::Ratio(v) => vec![TrackSizing::Relative(v.into())], diff --git a/src/library/layout/pad.rs b/src/library/layout/pad.rs index dfd425bd..9d91c641 100644 --- a/src/library/layout/pad.rs +++ b/src/library/layout/pad.rs @@ -65,7 +65,7 @@ fn shrink(size: Size, padding: Sides<Relative<Length>>) -> Size { /// (Vertical axis is analogous.) /// /// Let w be the grown target width, -/// s be given width, +/// s be the given width, /// l be the left padding, /// r be the right padding, /// p = l + r. diff --git a/src/library/layout/page.rs b/src/library/layout/page.rs index e2f414ab..0a7c7579 100644 --- a/src/library/layout/page.rs +++ b/src/library/layout/page.rs @@ -18,7 +18,7 @@ impl PageNode { /// Whether the page is flipped into landscape orientation. pub const FLIPPED: bool = false; - /// The page margin. + /// The page's margins. #[property(fold)] pub const MARGINS: Sides<Option<Smart<Relative<RawLength>>>> = Sides::splat(Smart::Auto); diff --git a/src/library/layout/place.rs b/src/library/layout/place.rs index 67e46d3b..4c6d0062 100644 --- a/src/library/layout/place.rs +++ b/src/library/layout/place.rs @@ -39,9 +39,8 @@ impl Layout for PlaceNode { // If expansion is off, zero all sizes so that we don't take up any // space in our parent. Otherwise, respect the expand settings. - let frame = &mut frames[0]; let target = regions.expand.select(regions.first, Size::zero()); - frame.resize(target, Align::LEFT_TOP); + frames[0].resize(target, Align::LEFT_TOP); Ok(frames) } diff --git a/src/library/layout/stack.rs b/src/library/layout/stack.rs index b1268404..d8dc0e1a 100644 --- a/src/library/layout/stack.rs +++ b/src/library/layout/stack.rs @@ -176,7 +176,8 @@ impl<'a> StackLayouter<'a> { self.finish_region(); } - // Align nodes' block-axis alignment is respected by the stack node. + // Block-axis alignment of the `AlignNode` is respected + // by the stack node. let align = node .downcast::<AlignNode>() .and_then(|node| node.aligns.get(self.axis)) |
