diff options
| author | Laurenz <laurmaedje@gmail.com> | 2019-11-17 20:57:50 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2019-11-17 20:57:50 +0100 |
| commit | 14259c7d09c12327b18aba21cc577e68ad283eda (patch) | |
| tree | 0f9a7a138141e84cfcb8691f41e29f7493879eab /src/layout/tree.rs | |
| parent | f6cb4d725ee6e4fd09b92b5af7348d11ac951b10 (diff) | |
Fix alignment bugs ✔
Diffstat (limited to 'src/layout/tree.rs')
| -rw-r--r-- | src/layout/tree.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/layout/tree.rs b/src/layout/tree.rs index 11e83209..b60ead9c 100644 --- a/src/layout/tree.rs +++ b/src/layout/tree.rs @@ -41,7 +41,7 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { } Node::Space => { - if !self.flex.box_is_empty() { + if !self.flex.box_is_empty() && !self.flex.last_is_space() { let space = self.style.word_spacing * self.style.font_size; self.flex.add_primary_space(space); } @@ -68,6 +68,7 @@ impl<'a, 'p> TreeLayouter<'a, 'p> { let commands = func.body.val.layout(LayoutContext { style: &self.style, spaces: self.flex.remaining()?, + shrink_to_fit: true, .. self.ctx })?; |
