From: Joe Neeman Date: Sun, 11 May 2008 06:08:35 +0000 (+1000) Subject: Fix 618. X-Git-Tag: release/2.11.46-1~18 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=67d33a99a916d9351d56a2382b0c82ebdd4381a5;p=lilypond.git Fix 618. Add a special case to the note-collision algorithm: if the lowermost upstem note is the same as the uppermost downstem note but the interval between the top two notes of the downstem is a second, don't shift the upstem chord to the left of the downstem chord. --- diff --git a/input/regression/collision-seconds.ly b/input/regression/collision-seconds.ly new file mode 100644 index 0000000000..812f986feb --- /dev/null +++ b/input/regression/collision-seconds.ly @@ -0,0 +1,10 @@ +\version "2.11.44" + +\header { + texidoc = "Seconds do not confuse the collision algorithm too much. The best +way to format this would be to merge the two Ds, but we will be happy for now +if the upstem D does not collide with the downstem C." +} + + +<< d' \\ >> diff --git a/lily/note-collision.cc b/lily/note-collision.cc index 894f16071f..7abcc2acc9 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -161,6 +161,13 @@ check_meshing_chords (Grob *me, Real shift_amount = 1; bool touch = (ups[0] >= dps.back ()); + /* As a special case, if the topmost part of the downstem chord is a second, + the top note of which is the same pitch as the lowest upstem note, they + shouldn't count as touching. + */ + if (dps.back () == ups[0] && dps.size () > 1 && dps[dps.size() - 2] == ups[0] - 1) + touch = false; + if (touch) shift_amount *= -1;