]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 618.
authorJoe Neeman <joeneeman@gmail.com>
Sun, 11 May 2008 06:08:35 +0000 (16:08 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Sun, 11 May 2008 06:08:35 +0000 (16:08 +1000)
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.

input/regression/collision-seconds.ly [new file with mode: 0644]
lily/note-collision.cc

diff --git a/input/regression/collision-seconds.ly b/input/regression/collision-seconds.ly
new file mode 100644 (file)
index 0000000..812f986
--- /dev/null
@@ -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' \\ <c' d'> >>
index 894f16071fa5d5e76e0d2101ffe4a897e47c13b3..7abcc2acc9c7bc4f0e94905747bfb3d767c4576c 100644 (file)
@@ -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;