summaryrefslogtreecommitdiff
path: root/src/layout/par.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-08-17 00:17:28 +0200
committerLaurenz <laurmaedje@gmail.com>2021-08-17 00:17:28 +0200
commit9a798ce6f6e734a02764473891632c071fed41ee (patch)
treecb433d5b6309f55799749c19eec8579d86bf36b2 /src/layout/par.rs
parent9462fb17b390c57846b9215217ca7c32b649f0a5 (diff)
Make percentages for h and v relative to area instead of font size
Diffstat (limited to 'src/layout/par.rs')
-rw-r--r--src/layout/par.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layout/par.rs b/src/layout/par.rs
index a88a0f0b..c8512243 100644
--- a/src/layout/par.rs
+++ b/src/layout/par.rs
@@ -27,7 +27,7 @@ pub struct ParNode {
#[cfg_attr(feature = "layout-cache", derive(Hash))]
pub enum ParChild {
/// Spacing between other nodes.
- Spacing(Length),
+ Spacing(Linear),
/// A run of text and how to align it in its line.
Text(EcoString, Align, Rc<FontState>),
/// Any child node and how to align it in its line.
@@ -137,7 +137,8 @@ impl<'a> ParLayouter<'a> {
for (range, child) in par.ranges().zip(&par.children) {
match *child {
ParChild::Spacing(amount) => {
- items.push(ParItem::Spacing(amount));
+ let resolved = amount.resolve(regions.current.width);
+ items.push(ParItem::Spacing(resolved));
ranges.push(range);
}
ParChild::Text(_, align, ref state) => {