From: Keith OHara Date: Sun, 5 Feb 2012 06:50:35 +0000 (-0800) Subject: page-layout: loose lines between systems; issue 2276 X-Git-Tag: release/2.15.29-1~8 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7a60a342;hp=c74e3c672472e22f28abc82d1705188add41a229;p=lilypond.git page-layout: loose lines between systems; issue 2276 --- diff --git a/input/regression/page-spacing-nonstaff-lines-between-systems.ly b/input/regression/page-spacing-nonstaff-lines-between-systems.ly index b1d161bb8d..fd9009bfc9 100644 --- a/input/regression/page-spacing-nonstaff-lines-between-systems.ly +++ b/input/regression/page-spacing-nonstaff-lines-between-systems.ly @@ -3,11 +3,11 @@ \header { texidoc = "The vertical spacing engine is not confused by a non-staff line below a system followed by a loose line above the -next system." +next system. Systems are spaced far enough that loose lines +are not interleaved, even if gaps would allow interleaving." } \paper { - indent = 0 ragged-right = ##t } diff --git a/lily/include/page-layout-problem.hh b/lily/include/page-layout-problem.hh index fc7e105510..12455c6fe7 100644 --- a/lily/include/page-layout-problem.hh +++ b/lily/include/page-layout-problem.hh @@ -95,6 +95,7 @@ protected: vector solution_; Real force_; Skyline bottom_skyline_; + Real bottom_loose_baseline_; Real page_height_; Real header_height_; Real footer_height_; diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index 39260b4173..6320827c76 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -380,6 +380,7 @@ Page_layout_problem::Page_layout_problem (Paper_book *pb, SCM page_scm, SCM syst : bottom_skyline_ (DOWN) { Prob *page = unsmob_prob (page_scm); + bottom_loose_baseline_ = 0; header_height_ = 0; footer_height_ = 0; header_padding_ = 0; @@ -596,12 +597,17 @@ Page_layout_problem::append_system (System *sys, Spring const &spring, Real inde { if (is_spaceable (elts[i])) { - // We don't add a spring for the first staff, since - // we are only adding springs _between_ staves here. if (!found_spaceable_staff) { + // Ensure space for any loose lines above this system + if (i > 0) + springs_.back ().ensure_min_distance (bottom_loose_baseline_ + - minimum_offsets_with_min_dist[i] + + padding); found_spaceable_staff = true; last_spaceable_staff = i; + // We don't add a spring for the first staff, since + // we are only adding springs _between_ staves here. continue; } @@ -629,6 +635,11 @@ Page_layout_problem::append_system (System *sys, Spring const &spring, Real inde } } + bottom_loose_baseline_ = found_spaceable_staff + ? ( minimum_offsets_with_min_dist[last_spaceable_staff] + - minimum_offsets_with_min_dist.back ()) + : 0; + // Corner case: there was only one staff, and it wasn't spaceable. // Mark it spaceable, because we do not allow non-spaceable staves // to be at the top or bottom of a system.