X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpage-layout-problem.cc;h=6320827c767a74b07078d328eb7041d7649f6179;hb=3fa8dfbe7c4d70010f5182f3c684f241762d9ec9;hp=39260b4173edc98845cee4d038bf0a8e1d2b51fc;hpb=d61cf3bbdb1c6670a127ba3baddf2f04d3e34fd3;p=lilypond.git 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.