X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frest-collision.cc;h=e0a494c0c5431fc9440850372c965bbb35303587;hb=9ae52034113dcfbbc98fd7a0f8075ca3ea2cf3c9;hp=063b773a92ae2f3ccf58792ba566095bf884b0a2;hpb=c3ff1c6cd20e15e9036ee7120012e05b1d62a46d;p=lilypond.git diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index 063b773a92..e0a494c0c5 100644 --- a/lily/rest-collision.cc +++ b/lily/rest-collision.cc @@ -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 " + );