]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/constrained-breaking.cc
Merge branch 'staging' of ssh://git.sv.gnu.org/srv/git/lilypond into staging
[lilypond.git] / lily / constrained-breaking.cc
index 7e5bfadd50e054421a7d42d500c072c2fefc3b94..c8b7fc1d748bc06ae2074d33d436d77ab1bdd2e5 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2006--2011 Joe Neeman <joeneeman@gmail.com>
+  Copyright (C) 2006--2012 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
@@ -436,10 +436,10 @@ Constrained_breaking::initialize ()
   breaks_ = pscore_->get_break_indices ();
   all_ = pscore_->root_system ()->used_columns ();
   lines_.resize (breaks_.size (), breaks_.size (), Line_details ());
-  vector<Simple_spacer> spacers =
-    pscore_->root_system ()->get_simple_spacers(other_lines.length (),
-                                                other_lines.length () - first_line.length (),
-                                                ragged_right_);
+  vector<Real> forces = get_line_forces (all_,
+                                         other_lines.length (),
+                                         other_lines.length () - first_line.length (),
+                                         ragged_right_);
   for (vsize i = 0; i + 1 < breaks_.size (); i++)
     {
       for (vsize j = i + 1; j < breaks_.size (); j++)
@@ -448,18 +448,9 @@ Constrained_breaking::initialize ()
           bool ragged = ragged_right_ || (last && ragged_last_);
           Line_details &line = lines_.at (j, i);
 
-          line.force_ = spacers[i * breaks_.size () + j].force_penalty (ragged_right_);
-          if (!spacers[i * breaks_.size () + j].fits ())
-            {
-              if (spacers[i * breaks_.size () + j].minimal_)
-                line.force_ = -200000;
-              else
-                line.force_ = infinity_f;
-            }
+          line.force_ = forces[i * breaks_.size () + j];
           if (ragged && last && !isinf (line.force_))
             line.force_ = (line.force_ < 0 && j > i + 1) ? infinity_f : 0;
-          if (!line.force_ && !spacers[i * breaks_.size () + j].line_len ())
-            line.force_ = infinity_f;
           if (isinf (line.force_))
             break;