From: Han-Wen Nienhuys Date: Sun, 25 May 2003 22:05:42 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/1.7.20~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=98fa1e7343021a9e19b2326cafe48d3f198c95e1;p=lilypond.git *** empty log message *** --- diff --git a/lily/gourlay-breaking.cc b/lily/gourlay-breaking.cc index ae4c3073a4..157fda6160 100644 --- a/lily/gourlay-breaking.cc +++ b/lily/gourlay-breaking.cc @@ -235,15 +235,15 @@ Gourlay_breaking::combine_demerits (Column_x_positions const &prev, Q: do want globally non-cramped lines, or locally equally cramped lines. */ Real demerit = abs (this_one.force_) + abs (prev.force_ - this_one.force_) - + break_penalties - /* - This is rather ugly (not scale free), but we have to put a - penalty breaking two zero-force lines. Otherwise, we don't get a - unique solution (i.e.: line-breaks in short raggedright - fragments.) - */ - + 1e-5; + + break_penalties; + /* + This is rather ugly (not scale free), but we have to put a + penalty breaking two zero-force lines. Otherwise, we don't get a + unique solution (i.e.: line-breaks in short raggedright + fragments.) + */ + if (!this_one.satisfies_constraints_b_) { /* diff --git a/lily/simple-spacer.cc b/lily/simple-spacer.cc index dceebef282..893b8cb0fd 100644 --- a/lily/simple-spacer.cc +++ b/lily/simple-spacer.cc @@ -144,7 +144,7 @@ Simple_spacer::active_blocking_force () const Real Simple_spacer::active_springs_stiffness () const { - range_stiffness (0, springs_.size ()); + return range_stiffness (0, springs_.size ()); } void @@ -326,20 +326,11 @@ Simple_spacer::solve (Column_x_positions *positions, bool ragged) else my_solve_linelen (); - positions->force_ = force_; - if ((force_ < 0)) - { - - /* - We used to have a penalty for compression, no matter what, but that - fucked up wtk1-fugue2 (taking 3 full pages.) - - maybe this should be tunable? - */ - if (compression_penalty_b_) - ; // positions->force_ *= 2; // hmm. - } + /* + We used to have a penalty for compression, no matter what, but that + fucked up wtk1-fugue2 (taking 3 full pages.) + */ positions->config_.push (indent_); for (int i=0; i = 0 here, up to rounding errors */ } + + if (ragged && line_len_ > 0) + { + Real len = positions->config_.top (); + positions->force_ = (line_len_ - len) * active_springs_stiffness (); + } + + positions->cols_ = spaced_cols_; positions->loose_cols_ = loose_cols_;