From: Joe Neeman Date: Tue, 11 Nov 2008 06:37:19 +0000 (-0800) Subject: If systems-per-page is specified and a page is overfull, don't barf. X-Git-Tag: release/2.13.1-1~61^2~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d0c3f3daf1eb5095154fceba15d24d39aadc2027;p=lilypond.git If systems-per-page is specified and a page is overfull, don't barf. --- diff --git a/lily/page-breaking.cc b/lily/page-breaking.cc index 96b9d3a0db..639cbd5ceb 100644 --- a/lily/page-breaking.cc +++ b/lily/page-breaking.cc @@ -866,15 +866,18 @@ Page_breaking::space_systems_with_fixed_number_per_page (vsize configuration, } res.systems_per_page_.push_back (line - page_first_line); - res.force_.push_back (space.force_); + + // Don't say that the force is infinite even if it is: if we were told to + // put a certain number of systems on a page then we will, even if it's bad. + res.force_.push_back (min (space.force_, BAD_SPACING_PENALTY)); res.penalty_ += cached_line_details_[line-1].page_penalty_; page_first_line = line; } /* Recalculate forces for the last page because we know now that is - was really the last page. */ + really the last page. */ space.resize (page_height (first_page_num + page, true)); - res.force_.back () = space.force_; + res.force_.back () = min(space.force_, BAD_SPACING_PENALTY); return finalize_spacing_result (configuration, res); } @@ -963,7 +966,7 @@ Page_breaking::finalize_spacing_result (vsize configuration, Page_spacing_result { Real f = res.force_[i]; if (isinf (f) && res.systems_per_page_[i] == 1) - f = 20000; + f = BAD_SPACING_PENALTY; page_force += f * f; }