]> 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)
committerJoe Neeman <joeneeman@gmail.com>
Sun, 11 Mar 2007 02:02:17 +0000 (13:02 +1100)
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 fb8e75e8b26c7bafc63452e116b6e19b6172fa76..820afa59e8b31a200d790226428b7ba285cf6a67 100644 (file)
@@ -17,7 +17,8 @@ struct Semi_tie_column
 {
   DECLARE_GROB_INTERFACE();
   
-  DECLARE_SCHEME_CALLBACK(calc_positioning_done, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_positioning_done, (SCM));
+  DECLARE_SCHEME_CALLBACK (calc_head_direction, (SCM));
 };
 
 
index 70d431f10591237996c81dd50bdac51b8824dae2..4b1bf76a39c90ae6aa130a6287baed6765db8a8e 100644 (file)
@@ -72,4 +72,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 85d48b1394833d7b52c3fe2a11eeb61b7e1ca970..d44d3412cb187499f9bc3f5cc0a924d539ef25da 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)