]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 25 May 2003 22:05:42 +0000 (22:05 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 25 May 2003 22:05:42 +0000 (22:05 +0000)
lily/gourlay-breaking.cc
lily/simple-spacer.cc

index ae4c3073a4382e1102ec54aa23c20c5e8f11500b..157fda61605a6dbcf785ca2d55c8627c7c4ef2aa 100644 (file)
@@ -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_)
      {
        /*
index dceebef282f85c7e54ba3da9585340894f58fde2..893b8cb0fd7e25c2f4ebccfb44dcb50cf81b614a 100644 (file)
@@ -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 <springs_.size (); i++)
@@ -350,6 +341,14 @@ Simple_spacer::solve (Column_x_positions *positions, bool ragged)
        we have l>= 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_;