X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fconstrained-breaking.cc;h=c8b7fc1d748bc06ae2074d33d436d77ab1bdd2e5;hb=c633bea462ad673cf59f5288b87027c7519c4d4f;hp=0a185bf39d00e3b1be3ef34647ace171f0a138aa;hpb=0c61221b46addec50e2406e04af44a7d460443d4;p=lilypond.git diff --git a/lily/constrained-breaking.cc b/lily/constrained-breaking.cc index 0a185bf39d..c8b7fc1d74 100644 --- a/lily/constrained-breaking.cc +++ b/lily/constrained-breaking.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2006--2011 Joe Neeman + Copyright (C) 2006--2012 Joe Neeman 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 spacers - = pscore_->root_system ()->get_simple_spacers (other_lines.length (), - other_lines.length () - first_line.length (), - ragged_right_); + vector 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;