X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frest-collision.cc;h=29313f1ccbac720f4d64466c72e0b79eb75c55be;hb=5b4b0d6e9a197e8f9eb085b7c2ad78b8be3e5cfc;hp=063b773a92ae2f3ccf58792ba566095bf884b0a2;hpb=3f8485925e8c879fe4c9ae86acef9804126c3b91;p=lilypond.git diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 063b773a92..29313f1ccb 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2007 Han-Wen Nienhuys + (c) 1997--2008 Han-Wen Nienhuys */ #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 " + );