X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frest-collision.cc;h=6448492b8f5f925b954fe9fb4064b4b0cb50cb2a;hb=09bf9a18185476020686ff65b5d70b57051be780;hp=e0a494c0c5431fc9440850372c965bbb35303587;hpb=41e45dd730c075e78065dfa78e5e54be664d905e;p=lilypond.git diff --git a/lily/rest-collision.cc b/lily/rest-collision.cc index e0a494c0c5..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.