]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/separating-group-spanner.cc
* lily/melisma-engraver.cc (try_music): use melisma_busy()
[lilypond.git] / lily / separating-group-spanner.cc
index f4471530bf217091788c94b30925299ff52d3d84..cfe9409140b9bc092250b503cca411a8356a8082 100644 (file)
@@ -3,7 +3,7 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
@@ -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).is_empty ())
+    return; 
+  
   for(; gh_pair_p (next); next = ly_cdr (next))
     {
       Item *l = dynamic_cast<Item*> (unsmob_grob (ly_car( next)));
@@ -31,41 +36,38 @@ Separating_group_spanner::find_rods (Item * r, SCM next)
        {
          Interval li (Separation_item::width (lb));
          Interval ri (Separation_item::conditional_width (r, lb));
-         if (!li.empty_b () && !ri.empty_b())
+         if (!li.is_empty () && !ri.is_empty ())
            {
              Rod rod;
 
              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 ();
            }
        }
 
       Interval li (Separation_item::width (l));
       Interval ri (Separation_item::conditional_width (r, l));
-      if (!li.empty_b () && !ri.empty_b())
+      if (!li.is_empty () && !ri.is_empty ())
        {
          Rod rod;
 
          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.
+      */
+
     }
 }