lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fixing issue #44


From: Erlend Aasland
Subject: Fixing issue #44
Date: Thu, 12 Oct 2006 10:15:16 +0200

Hello,

I had a look at issue #44 yesterday and came up with this patch (attached). It fixes the bug, but I guess using the side-position interface in some clever way can get rid of the magic numbers. Comments?

diff -u -r1.71 note-collision.cc
--- lily/note-collision.cc      17 Sep 2006 11:02:29 -0000      1.71
+++ lily/note-collision.cc      12 Oct 2006 08:05:59 -0000
@@ -16,6 +16,7 @@
 #include "output-def.hh"
 #include "pointer-group-interface.hh"
 #include "rhythmic-head.hh"
+#include "staff-symbol-referencer.hh"
 #include "side-position-interface.hh"
 #include "stem.hh "
 #include "warn.hh"
@@ -242,6 +243,24 @@
   else
     shift_amount *= 0.17;
 
+  /*
+   * Handle issue #44:
+   *
+   * Dots from left note head collide with right note head. Only occurs
+   * with a close half collide, if the left note head is between
+   * lines and the right note head is on a line, and if right note head
+   * hasn't got any dots.
+   */
+  if (close_half_collide
+      && Rhythmic_head::dot_count (nu)
+      && !Rhythmic_head::dot_count (nd))
+  {
+    Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
+    if (!Staff_symbol_referencer::on_line (staff, ups[0]))
+      /* FIXME: magic numbers */
+      shift_amount *= 1 + (0.6 * Rhythmic_head::dot_count (nu));
+  }
+
   /* For full or close half collisions, the right hand head may
      obscure dots.  Move dots to the right.  */
   if (abs (shift_amount) > 1e-6



Regards,
  Erlend Aasland

Attachment: issue44.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]