diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-11-16 18:15:47 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-11-16 18:15:47 +0100 |
| commit | 0cdf17216f47312f634d2dea8db237118ede72ce (patch) | |
| tree | 1aa53f44f12da2f4473e72f166ecca380e72b4bb /src/library/par.rs | |
| parent | 79638d4bbdc140a8dca0ccfdf70ffd607d5da251 (diff) | |
Abstraction for fr resolving
Diffstat (limited to 'src/library/par.rs')
| -rw-r--r-- | src/library/par.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/library/par.rs b/src/library/par.rs index d0f31016..64b68c68 100644 --- a/src/library/par.rs +++ b/src/library/par.rs @@ -498,12 +498,7 @@ impl<'a> LineLayout<'a> { match *item { ParItem::Absolute(v) => offset += v, - ParItem::Fractional(v) => { - let ratio = v / self.fr; - if remaining.is_finite() && ratio.is_finite() { - offset += ratio * remaining; - } - } + ParItem::Fractional(v) => offset += v.resolve(self.fr, remaining), ParItem::Text(ref shaped, align) => position(shaped.build(), align), ParItem::Frame(ref frame, align) => position(frame.clone(), align), } |
