]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/separating-group-spanner.cc
* GNUmakefile.in: config.h message fix.
[lilypond.git] / lily / separating-group-spanner.cc
index f4471530bf217091788c94b30925299ff52d3d84..d841599246fb8fd4c67235d09af00e339f100b06 100644 (file)
@@ -19,9 +19,14 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
 {
 
   /*
-    This is an inner loop, however, in most cases, the interesting L
-    will just be the first entry of NEXT, making it linear in most of
-    the cases.  */
+    This is an inner loop: look for the first normal (unbroken) Left
+    grob.  This looks like an inner loop (ie. quadratic total), but in
+    most cases, the interesting L will just be the first entry of
+    NEXT, making it linear in most of the cases.
+  */
+  if (Separation_item::width (r).empty_b ())
+    return; 
+  
   for(; gh_pair_p (next); next = ly_cdr (next))
     {
       Item *l = dynamic_cast<Item*> (unsmob_grob (ly_car( next)));
@@ -38,9 +43,7 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
              rod.item_l_drul_[LEFT] = lb;
              rod.item_l_drul_[RIGHT] = r;
 
-             rod.distance_f_ = li[RIGHT] - ri[LEFT];
-       
-             rod.columnize ();
+             rod.distance_ = li[RIGHT] - ri[LEFT];
              rod.add_to_cols ();
            }
        }
@@ -54,18 +57,17 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
          rod.item_l_drul_[LEFT] =l;
          rod.item_l_drul_[RIGHT]=r;
 
-         rod.distance_f_ = li[RIGHT] - ri[LEFT];
+         rod.distance_ = li[RIGHT] - ri[LEFT];
        
-         rod.columnize ();
          rod.add_to_cols ();
-
          break;
        }
-      else
-       /*
-         this grob doesn't cause a constraint. We look further until we
-         find one that does.  */
-       ;
+
+      /*
+       this grob doesn't cause a constraint. We look further until we
+       find one that does.
+      */
+
     }
 }