]> git.donarmstrong.com Git - lilypond.git/commitdiff
take the left most head as bound for the TieColumn. Fixes #166.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 17 Dec 2006 18:34:02 +0000 (19:34 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 17 Dec 2006 18:34:19 +0000 (19:34 +0100)
lily/tie-column.cc

index 13d5fb0177c1fba2577b293ee0e75c2cb8a3c7b3..40e5d74ad04069103358a43457880ad7925c6e22 100644 (file)
 using namespace std;
 
 void
-Tie_column::add_tie (Grob *me, Grob *tie)
+Tie_column::add_tie (Grob *tc, Grob *tie)
 {
+  Spanner *me = dynamic_cast<Spanner *> (tc);
+  
   if (tie->get_parent (Y_AXIS)
       && Tie_column::has_interface (tie->get_parent (Y_AXIS)))
     return;
 
-  if (!Pointer_group_interface::count (me, ly_symbol2scm ("ties")))
+  if (!me->get_bound (LEFT)
+      || (Paper_column::get_rank (me->get_bound (LEFT)->get_column ())
+         > Paper_column::get_rank (dynamic_cast<Spanner*> (tie)->get_bound (LEFT)->get_column ())))
     {
-      dynamic_cast<Spanner *> (me)->set_bound (LEFT, Tie::head (tie, LEFT));
-      dynamic_cast<Spanner *> (me)->set_bound (RIGHT, Tie::head (tie, RIGHT));
+       me->set_bound (LEFT, Tie::head (tie, LEFT));
+       me->set_bound (RIGHT, Tie::head (tie, RIGHT));
     }
-
+      
   tie->set_parent (me, Y_AXIS);
   Pointer_group_interface::add_grob (me, ly_symbol2scm ("ties"), tie);
 }