From: Joe Neeman <joeneeman@gmail.com> Date: Thu, 23 Dec 2010 00:23:41 +0000 (+0700) Subject: More informative warning for ragged pages. X-Git-Tag: release/2.13.44-1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d0a10b130ca01f3923b6a793a785d1d66455ab55;p=lilypond.git More informative warning for ragged pages. --- diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc index e9a00093d9..673278f69c 100644 --- a/lily/page-layout-problem.cc +++ b/lily/page-layout-problem.cc @@ -312,13 +312,18 @@ Page_layout_problem::solve_rod_spring_problem (bool ragged) { 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; + if (ragged && overflow < 1e-6) + warning (_ ("couldn't fit music on page: ragged-spacing was requested, but page was compressed")); + else + { + 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; + } } }