From 79d851cd0bb864da8de980965472c2b7f2fbdb1f Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 22 Jan 2023 13:18:58 +0100 Subject: [PATCH] Fix fr handling for horizontal auto page --- library/src/layout/par.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/layout/par.rs b/library/src/layout/par.rs index 7db19095f..2427aa98b 100644 --- a/library/src/layout/par.rs +++ b/library/src/layout/par.rs @@ -1123,7 +1123,7 @@ fn finalize( ) -> SourceResult { // Determine the paragraph's width: Full width of the region if we // should expand or there's fractional spacing, fit-to-width otherwise. - if !expand && lines.iter().all(|line| line.fr().is_zero()) { + if !width.is_finite() || (!expand && lines.iter().all(|line| line.fr().is_zero())) { width = lines.iter().map(|line| line.width).max().unwrap_or_default(); }