From 8d33d996fee9e48a7bfc433139c5b6d27f154a0b Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Sun, 11 Mar 2007 13:02:17 +1100 Subject: [PATCH] Fix #332. Make sure the head-direction of a RepeatTieColumn is the same as the head-direction of its RepeatTies. --- lily/include/semi-tie-column.hh | 3 ++- lily/semi-tie-column.cc | 19 +++++++++++++++++++ scm/define-grobs.scm | 2 +- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lily/include/semi-tie-column.hh b/lily/include/semi-tie-column.hh index cfeb7fc779..055735b429 100644 --- a/lily/include/semi-tie-column.hh +++ b/lily/include/semi-tie-column.hh @@ -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)); }; diff --git a/lily/semi-tie-column.cc b/lily/semi-tie-column.cc index 055b377c72..c5dfe16922 100644 --- a/lily/semi-tie-column.cc +++ b/lily/semi-tie-column.cc @@ -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); +} diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index b1778a75b4..f8d06c0047 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1304,7 +1304,7 @@ (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) -- 2.39.5