]> git.donarmstrong.com Git - lilypond.git/commitdiff
More informative warning for ragged pages.
authorJoe Neeman <joeneeman@gmail.com>
Thu, 23 Dec 2010 00:23:41 +0000 (07:23 +0700)
committerJoe Neeman <joeneeman@gmail.com>
Thu, 23 Dec 2010 00:30:06 +0000 (07:30 +0700)
lily/page-layout-problem.cc

index e9a00093d9ded28f757b45d8a339d852beda27d3..673278f69c6fc9490ab118d406610531064b6d9e 100644 (file)
@@ -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;
+       }
     }
 }