]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/rest-collision.cc
Run `make grand-replace'.
[lilypond.git] / lily / rest-collision.cc
index 063b773a92ae2f3ccf58792ba566095bf884b0a2..29313f1ccbac720f4d64466c72e0b79eb75c55be 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "rest-collision.hh"
@@ -227,8 +227,24 @@ Rest_collision::calc_positioning_done (SCM smob)
 
       Interval notedim;
       for (vsize i = 0; i < notes.size (); i++)
-       notedim.unite (notes[i]->extent (common, Y_AXIS));
-
+       {
+         if (Note_column::dir (notes[i]) == -dir)
+           {
+             /* try not to look at the stem, as looking at a beamed
+                note may trigger beam positioning prematurely.
+
+                This happens with dotted rests, which need Y
+                positioning to compute X-positioning.
+             */
+             Grob *head = Note_column::first_head (notes[i]);
+             if (head)
+               notedim.unite (head->extent (common, Y_AXIS));
+             else
+               programming_error ("Note_column without first_head()");
+           }
+         else
+           notedim.unite (notes[i]->extent (common, Y_AXIS));
+       }
 
       Real y = dir * max (0.0,
                          -dir * restdim[-dir] + dir * notedim[dir]  + minimum_dist);
@@ -256,11 +272,12 @@ Rest_collision::calc_positioning_done (SCM smob)
 }
 
 ADD_INTERFACE (Rest_collision,
-              "Move around ordinary rests (not multi-measure-rests) to avoid "
-              "conflicts.",
+              "Move around ordinary rests (not multi-measure-rests) to avoid"
+              " conflicts.",
 
               /* properties */
               "minimum-distance "
               "positioning-done "
-              "elements");
+              "elements "
+              );