]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/page-spacing.cc
Merge branch 'master' into lilypond/translation
[lilypond.git] / lily / page-spacing.cc
index b3a7ed8a4146f3ddbd8e9da8f1a7e1b9968cf0bb..17ba73d9239846e49c4e1d8e7fe23345e30e6efe 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2006--2010 Joe Neeman <joeneeman@gmail.com>
+  Copyright (C) 2006--2011 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
@@ -50,6 +50,8 @@ Page_spacing::append_system (const Line_details &line)
   if (rod_height_)
     {
       rod_height_ += line.tallness_;
+      spring_len_ += last_line_.spring_length (line);
+
     }
   else
     {
@@ -57,7 +59,6 @@ Page_spacing::append_system (const Line_details &line)
       first_line_ = line;
     }
 
-  spring_len_ += line.space_;
   inverse_spring_k_ += line.inverse_hooke_;
 
   last_line_ = line;
@@ -68,13 +69,15 @@ Page_spacing::append_system (const Line_details &line)
 void
 Page_spacing::prepend_system (const Line_details &line)
 {
-  if (!rod_height_)
+  if (rod_height_)
+    spring_len_ += line.spring_length (first_line_);
+  else
     last_line_ = line;
 
   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_;
 
   first_line_ = line;