summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Sorensen <c_sorensen@byu.edu>2010-12-04 15:26:17 -0700
committerCarl Sorensen <c_sorensen@byu.edu>2010-12-04 15:28:09 -0700
commit4854cc6ddec1fb33c233fbff5085e81de95219db (patch)
tree34dd4a16062415697e9e4a36e1989f2c74b7c997
parentca1c206bb968f272363a2e0d5b9abaf97ddd6f5c (diff)
Adjust page compression settings
Adjust compression when the sytems won't fit on the page so we don't drive off the top of the page.
-rw-r--r--input/regression/page-breaking-min-systems-per-page2.ly11
-rw-r--r--lily/page-layout-problem.cc10
2 files changed, 13 insertions, 8 deletions
diff --git a/input/regression/page-breaking-min-systems-per-page2.ly b/input/regression/page-breaking-min-systems-per-page2.ly
index 6d5550912f..08988311b6 100644
--- a/input/regression/page-breaking-min-systems-per-page2.ly
+++ b/input/regression/page-breaking-min-systems-per-page2.ly
@@ -1,10 +1,13 @@
-\version "2.13.1"
+\version "2.13.42"
#(set-default-paper-size "a6")
\header {
- texidoc = "The min-systems-per-page variable takes precedence over
-the desire not to overfill a page."
+ texidoc = "
+The min-systems-per-page variable takes precedence over
+the desire not to overfill a page. In this case, systems will
+overlap because they are forced to be on the page.
+"
}
\book {
@@ -13,4 +16,4 @@ the desire not to overfill a page."
}
\repeat unfold 21 { c'1 }
-} \ No newline at end of file
+}
diff --git a/lily/page-layout-problem.cc b/lily/page-layout-problem.cc
index 4f035d7279..aec0b80ac8 100644
--- a/lily/page-layout-problem.cc
+++ b/lily/page-layout-problem.cc
@@ -310,13 +310,15 @@ Page_layout_problem::solve_rod_spring_problem (bool ragged)
if (!spacer.fits ())
{
- Real overflow = spacer.configuration_length (spacer.force ()) - page_height_;
- vsize space_count = solution_.size ();
- for (vsize i = 0; i < space_count; i++)
- solution_[i] -= (i + 1) * overflow / space_count;
+ 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;
}
}