]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-spacing.cc
Fix 1112.
[lilypond.git] / lily / page-spacing.cc
index 8dbf1834cf3e332de74b78642c5c6307dd81cbc2..33cf18a3fe8a64f52821229f96a3bd73e407ab1c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2006--2009 Joe Neeman <joeneeman@gmail.com>
+  Copyright (C) 2006--2010 Joe Neeman <joeneeman@gmail.com>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -47,12 +47,16 @@ Page_spacing::resize (Real new_height)
 void
 Page_spacing::append_system (const Line_details &line)
 {
-  if (!rod_height_)
-    first_line_ = line;
-
-  rod_height_ += line.title_ ? last_line_.title_padding_ : last_line_.padding_;
+  if (rod_height_)
+    {
+      rod_height_ += line.tallness_;
+    }
+  else
+    {
+      rod_height_ += line.full_height ();
+      first_line_ = line;
+    }
 
-  rod_height_ += line.extent_.length ();
   spring_len_ += line.space_;
   inverse_spring_k_ += line.inverse_hooke_;
 
@@ -64,12 +68,12 @@ Page_spacing::append_system (const Line_details &line)
 void
 Page_spacing::prepend_system (const Line_details &line)
 {
-  if (rod_height_)
-    rod_height_ += first_line_.title_ ? line.title_padding_ : line.padding_;
-  else
+  if (!rod_height_)
     last_line_ = line;
 
-  rod_height_ += line.extent_.length ();
+  rod_height_ -= first_line_.full_height ();
+  rod_height_ += first_line_.tallness_;
+  rod_height_ += line.full_height();
   spring_len_ += line.space_;
   inverse_spring_k_ += line.inverse_hooke_;