From e23b3a0ae90cd22ed684396c437435f2c0b5a773 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Fri, 14 Nov 2008 11:40:03 -0800 Subject: [PATCH] Fix a ragged-bottom/ragged-last-bottom corner case. When using ragged spacing, we want to pretend that the last page requires no force (so that we don't worsen the spacing of the previous pages in order to fill the last page). The previous check for this only worked if ragged-last-bottom = ##t, but not if ragged-bottom = ##t and ragged-last-bottom ##f. --- lily/optimal-page-breaking.cc | 2 ++ lily/page-spacing.cc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lily/optimal-page-breaking.cc b/lily/optimal-page-breaking.cc index 3c26c9abe0..b45781fd0a 100644 --- a/lily/optimal-page-breaking.cc +++ b/lily/optimal-page-breaking.cc @@ -63,6 +63,8 @@ Optimal_page_breaking::solve () if (page_count > 1 && best.systems_per_page_[page_count - 2] > 1) min_sys_count -= best.systems_per_page_[page_count - 2]; + + min_sys_count = max (min_sys_count, (vsize)1); } else { diff --git a/lily/page-spacing.cc b/lily/page-spacing.cc index 19129b3c17..78ad9a842a 100644 --- a/lily/page-spacing.cc +++ b/lily/page-spacing.cc @@ -204,7 +204,7 @@ Page_spacer::calc_subproblem (vsize page, vsize line) if (page > 0 || page_start == 0) { - if (line == lines_.size () - 1 && ragged_last_ && space.force_ > 0) + if (line == lines_.size () - 1 && ragged && last && space.force_ > 0) space.force_ = 0; /* we may have to deal with single lines that are taller than a page */ -- 2.39.2