From 39236e2230fa9ecd442bf9a3744f74d45856a397 Mon Sep 17 00:00:00 2001 From: Erlend Aasland Date: Fri, 13 Oct 2006 17:47:19 +0000 Subject: [PATCH] lily/note-collision.cc: fix issue #44 (dot/notehead collision) --- ChangeLog | 4 ++++ lily/note-collision.cc | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1058005e5d..b067a8a298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2006-10-13 Erlend Aasland + + * lily/note-collision.cc: fix issue #44 (dot/notehead collision) + 2006-10-13 Han-Wen Nienhuys * VERSION (PATCH_LEVEL): bump version. diff --git a/lily/note-collision.cc b/lily/note-collision.cc index d9a08dcdc8..7bcfa464ce 100644 --- a/lily/note-collision.cc +++ b/lily/note-collision.cc @@ -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,28 @@ check_meshing_chords (Grob *me, else shift_amount *= 0.17; + /* + * Fix 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])) + { + Grob *d = unsmob_grob (nu->get_object ("dot")); + Grob *parent = d->get_parent (X_AXIS); + if (Dot_column::has_interface (parent)) + Side_position_interface::add_support (parent, nd); + } + } + /* For full or close half collisions, the right hand head may obscure dots. Move dots to the right. */ if (abs (shift_amount) > 1e-6 -- 2.39.2