]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/simple-spacer.cc
* scm/define-markup-commands.scm (text): add \text markup command.
[lilypond.git] / lily / simple-spacer.cc
index 2b2529555c362219ea90df35e3596ab74eafa2d0..f23dfb84504eb71001f2214c90711d9a12867975 100644 (file)
@@ -74,7 +74,7 @@ Simple_spacer::add_rod (int l, int r, Real dist)
 {
   if (isinf (dist) || isnan (dist))
     {
-      programming_error ("Weird minimum distance. Ignoring");
+      programming_error ("ignoring weird minimum distance");
       return;
     }
 
@@ -100,11 +100,10 @@ Simple_spacer::add_rod (int l, int r, Real dist)
   Real block_stretch = dist - d;
 
   Real block_force = c * block_stretch;
-  force_ = force_ >? block_force;
+  force_ = max (force_, block_force);
 
   for (int i = l; i < r; i++)
-    springs_[i].block_force_ = block_force >?
-      springs_[i].block_force_;
+    springs_[i].block_force_ = max (block_force, springs_[i].block_force_);
 }
 
 Real
@@ -136,7 +135,7 @@ Simple_spacer::active_blocking_force () const
   for (int i = 0; i < springs_.size (); i++)
     if (springs_[i].is_active_)
       {
-       bf = bf >? springs_[i].block_force_;
+       bf = max (bf, springs_[i].block_force_);
       }
   return bf;
 }
@@ -222,7 +221,7 @@ Simple_spacer::my_solve_natural_len ()
 
   while (is_active ())
     {
-      force_ = active_blocking_force () >? 0.0;
+      force_ = max (active_blocking_force (), 0.0);
       Real conf = configuration_length ();
 
       if (conf < line_len_)
@@ -273,10 +272,10 @@ Spring_description::length (Real f) const
   by constraints, eg.
 
 
-  =====
-  |   |
-  o|o|  x ##x
-
+  .     =====
+  .     |   |
+  .o|o|x ##x
+  .
 
   The ## forces the notes apart; we shouldn't allow the O's to touch
   this closely.
@@ -350,7 +349,7 @@ Simple_spacer::add_spring (Real ideal, Real hooke)
   desc.hooke_ = hooke;
   if (!desc.is_sane ())
     {
-      programming_error ("Insane spring found. Setting to unit spring.");
+      programming_error ("insane spring found, setting to unit");
 
       desc.hooke_ = 1.0;
       desc.ideal_ = 1.0;
@@ -423,7 +422,8 @@ Simple_spacer_wrapper::add_columns (Link_array<Grob> const &icols)
        {
          Grob *other = unsmob_grob (scm_caar (s));
          int oi = binsearch_links (cols, other, &compare_paper_column_rank);
-         if (oi >= 0)
+         if (oi >= 0
+             && cols[oi] == other)
            {
              spacer_->add_rod (i, oi, scm_to_double (scm_cdar (s)));
            }