]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest-collision.cc
* input/test/ac-extra-voice.ly (accompany): remove file.
[lilypond.git] / lily / rest-collision.cc
index a0f7e744913840dc110440a3fc7fb3f762361c01..25b7636dfa1b3664a227bf6072e2409bed83ba56 100644 (file)
@@ -195,10 +195,20 @@ Rest_collision::do_shift (Grob *me)
        {
          warning (_ ("too many colliding rests"));
        }
-      Grob * rcol = rests[0];
-      Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
+      Grob * rcol = 0;
+      Direction dir = CENTER;
+
+      for (int i= rests.size (); !rcol && i--;)
+       if (Note_column::dir (rests[i]))
+         {
+           dir = Note_column::dir (rests[i]);
+           rcol = rests[i];
+         }
+
+      if (!rcol)
+       return SCM_UNSPECIFIED;
       
-      Direction dir = Note_column::dir (rests[0]);
+      Grob *common = common_refpoint_of_array (notes, rcol, Y_AXIS);
       
       Interval restdim = rcol->extent (common, Y_AXIS);
       if (restdim.is_empty ())