X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpage-layout-problem.cc;h=e9a00093d9ded28f757b45d8a339d852beda27d3;hb=120805bb7f7b56ec96fae0410774705377796064;hp=1a39ad51e8c21f681d1d345424b1c30931820e57;hpb=580faff1d6167b1500228dc5c5ae073dca0ead40;p=lilypond.git diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index 1a39ad51e8..e9a00093d9 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -309,8 +309,17 @@ Page_layout_problem::solve_rod_spring_problem (bool ragged) solution_ = spacer.spring_positions (); if (!spacer.fits ()) - warning (_f ("couldn't fit music on page: overflow is %f", - spacer.configuration_length(spacer.force()) - page_height_)); + { + Real overflow = spacer.configuration_length (spacer.force ()) + - page_height_; + warning (_f ("couldn't fit music on page: overflow is %f", + overflow)); + warning (_ ("compressing music to fit")); + vsize space_count = solution_.size (); + Real spacing_increment = overflow / (space_count - 2); + for (vsize i = 2; i < space_count; i++) + solution_[i] -= (i-1) * spacing_increment; + } } // The solution_ vector stores the position of every live VerticalAxisGroup @@ -643,7 +652,7 @@ Page_layout_problem::get_fixed_spacing (Grob *before, Grob *after, int spaceable Real stretchability = 0; if (Page_layout_problem::read_spacing_spec (spec, &stretchability, ly_symbol2scm ("stretchability")) && stretchability == 0) - Page_layout_problem::read_spacing_spec (spec, &ret, ly_symbol2scm ("space")); + Page_layout_problem::read_spacing_spec (spec, &ret, ly_symbol2scm ("basic-distance")); // If we're pure, then paper-columns have not had their systems set, // and so elts[i]->get_system () is unreliable. @@ -743,7 +752,7 @@ Page_layout_problem::alter_spring_from_spacing_spec (SCM spec, Spring* spring) Real space; Real stretch; Real min_dist; - if (read_spacing_spec (spec, &space, ly_symbol2scm ("space"))) + if (read_spacing_spec (spec, &space, ly_symbol2scm ("basic-distance"))) spring->set_distance (space); if (read_spacing_spec (spec, &min_dist, ly_symbol2scm ("minimum-distance"))) spring->set_min_distance (min_dist);