From d0a10b130ca01f3923b6a793a785d1d66455ab55 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Thu, 23 Dec 2010 07:23:41 +0700 Subject: [PATCH] More informative warning for ragged pages. --- lily/page-layout-problem.cc | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) 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; + } } } -- 2.39.2