X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frest-collision.cc;h=6448492b8f5f925b954fe9fb4064b4b0cb50cb2a;hb=8b649b5ed48e87329185796af4aa10352a08ca4b;hp=dd92f083e36db01a468dcc5a2acf9d1299cd11ad;hpb=95890ee80ae464e70e425dbd39b9798ff27d2bb7;p=lilypond.git diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index dd92f083e3..6448492b8f 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--2009 Han-Wen Nienhuys */ #include "rest-collision.hh" @@ -14,6 +14,7 @@ using namespace std; #include "directional-element-interface.hh" #include "duration.hh" #include "international.hh" +#include "item.hh" #include "note-column.hh" #include "output-def.hh" #include "pointer-group-interface.hh" @@ -228,7 +229,10 @@ Rest_collision::calc_positioning_done (SCM smob) Interval notedim; for (vsize i = 0; i < notes.size (); i++) { - if (Note_column::dir (notes[i]) == -dir) + if (Note_column::dir (notes[i]) == -dir + // If the note has already happened (but it has a long duration, so there is a collision), + // don't look at the stem. If we do, the rest gets shifted down a lot and it looks bad. + || dynamic_cast (notes[i])->get_column () != dynamic_cast (rest)->get_column ()) { /* try not to look at the stem, as looking at a beamed note may trigger beam positioning prematurely. @@ -272,11 +276,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 " + );