]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix min_page_count to take page-top-space into account.
authorJoe Neeman <joeneeman@gmail.com>
Fri, 22 May 2009 05:17:20 +0000 (22:17 -0700)
committerJoe Neeman <joeneeman@gmail.com>
Fri, 22 May 2009 05:49:41 +0000 (22:49 -0700)
lily/page-breaking.cc

index 4f096d8178e1a692e1097d9a28c13d0f40b52d61..668231f63aa95f6ab8092f0c2c547189a4861ab1 100644 (file)
@@ -762,6 +762,12 @@ Page_breaking::min_page_count (vsize configuration, vsize first_page_num)
   int line_count = 0;
 
   cache_line_details (configuration);
+
+  // If the first line on a page has titles, allow them some extra space.
+  if (cached_line_details_.size ()
+      && cached_line_details_[0].compressed_nontitle_lines_count_ < cached_line_details_[0].compressed_lines_count_)
+    cur_page_height += page_top_space ();
+
   for (vsize i = 0; i < cached_line_details_.size (); i++)
     {
       Real ext_len = cached_line_details_[i].extent_.length ();
@@ -780,6 +786,9 @@ Page_breaking::min_page_count (vsize configuration, vsize first_page_num)
          cur_rod_height = ext_len;
          cur_spring_height = cached_line_details_[i].space_;
          cur_page_height = page_height (first_page_num + ret, false);
+
+         if (cached_line_details_[i].compressed_nontitle_lines_count_ < cached_line_details_[i].compressed_lines_count_)
+           cur_page_height += page_top_space ();
          ret++;
        }
       else