2004-02-01 Jan Nieuwenhuizen <janneke@gnu.org>
+ * input/regression/collision-dots-move.ly: New test.
+
+ * lily/note-collision.cc (check_meshing_chords): Move dots on left
+ hand side note head of non-merged collision to the right.
+
* lily/new-lyric-combine-music-iterator.cc (start_new_syllable):
Construct children before accessing property from emtpy
lyrics_context_.
#include "axis-group-interface.hh"
#include "item.hh"
#include "stem.hh"
+#include "side-position-interface.hh"
+#include "dot-column.hh"
MAKE_SCHEME_CALLBACK (Note_collision_interface,force_shift_callback,2);
if (touch)
shift_amount *= -1;
- /*
- for full collisions, the right hand head may obscure dots, so
- make sure the dotted heads go to the right.
- */
- if ((Rhythmic_head::dot_count (nu) > Rhythmic_head::dot_count (nd)
- && full_collide))
+ /* For full collisions, the right hand head may obscure dots, so
+ make sure the dotted heads go to the right. */
+ if (Rhythmic_head::dot_count (nu) > Rhythmic_head::dot_count (nd)
+ && full_collide)
shift_amount = 1;
if (merge_possible)
else
shift_amount *= 0.25;
+ /* For full or close half collisions, the right hand head may
+ obscure dots. Move dots to the right. */
+ if (abs (shift_amount) > 1e-6
+ && Rhythmic_head::dot_count (nd) > Rhythmic_head::dot_count (nu)
+ && (full_collide || close_half_collide))
+ {
+ Grob *d = unsmob_grob (nd->get_grob_property ("dot"));
+ Grob *parent = d->get_parent (X_AXIS);
+ if (Dot_column::has_interface (parent))
+ Side_position_interface::add_support (parent, nu);
+ }
+
Direction d = UP;
do
{
do
{
for (int i=0; i < clash_groups[d].size (); i++)
- tups = gh_cons (gh_cons (clash_groups[d][i]->self_scm (), gh_double2scm (offsets[d][i])),
- tups);
+ tups = gh_cons (gh_cons (clash_groups[d][i]->self_scm (),
+ gh_double2scm (offsets[d][i])),
+ tups);
}
while (flip (&d) != UP);
return tups;