]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #332.
authorJoe Neeman <joeneeman@gmail.com>
Sun, 11 Mar 2007 02:02:17 +0000 (13:02 +1100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 16 Apr 2007 02:24:28 +0000 (22:24 -0400)
Make sure the head-direction of a RepeatTieColumn is the same as the
head-direction of its RepeatTies.

lily/include/semi-tie-column.hh
lily/semi-tie-column.cc
scm/define-grobs.scm

index cfeb7fc779bad333adf12f67dd173066986a2014..055735b429b5bdd73f6332b0a5e051961878bea9 100644 (file)
@@ -18,7 +18,8 @@ struct Semi_tie_column
 {
   static bool has_interface (Grob *);
   
-  DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_head_direction, (SCM));
 };
 
 
index 055b377c72107416ea3f7080a8e47232164a62fa..c5dfe169221ec89b44c753adb738ba23e23bdf53 100644 (file)
@@ -68,4 +68,23 @@ Semi_tie_column::calc_positioning_done (SCM smob)
   return SCM_BOOL_T;
 }
   
+MAKE_SCHEME_CALLBACK (Semi_tie_column, calc_head_direction, 1);
+SCM
+Semi_tie_column::calc_head_direction (SCM smob)
+{
+  Grob *me = unsmob_grob (smob);
 
+  extract_grob_set (me, "ties", ties);
+  Direction d = LEFT;
+  for (vsize i = 0; i < ties.size (); i++)
+    {
+      Direction this_d = to_dir (ties[i]->get_property ("head-direction"));
+      if (i > 0 && d != this_d)
+       {
+         programming_error ("all semi-ties in a semi-tie-column should have the same head-direction");
+         return scm_from_int (d);
+       }
+      d = this_d;
+    }
+  return scm_from_int (d);
+}
index b1778a75b4475d44cecf34698915c2631c5423cc..f8d06c00474fd67b970f86354aa1e3a5acefeb0f 100644 (file)
        (X-extent . #f)
        (Y-extent . #f)
        (direction . ,ly:tie::calc-direction)
-       (head-direction . ,RIGHT)
+       (head-direction . ,ly:semi-tie-column::calc-head-direction)
        
        (positioning-done . ,ly:semi-tie-column::calc-positioning-done)
        (meta . ((class . Item)