From ca2de5fb00b832f2875583734af4a74c70e192f6 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 26 Jan 2007 02:04:28 +0100 Subject: [PATCH] fixes for cyclic dependencies. --- input/regression/music-map.ly | 2 +- lily/beam-quanting.cc | 21 +++++++++++++-------- lily/stem.cc | 14 ++++++++------ 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/input/regression/music-map.ly b/input/regression/music-map.ly index 1a1afb1d28..1450098a1c 100644 --- a/input/regression/music-map.ly +++ b/input/regression/music-map.ly @@ -37,5 +37,5 @@ foobar = \transpose c c' { c4\>-^ c4-^ c4\!-^ c4-^ } << \applyMusic #(lambda (x) (music-map notes-to-skip x)) \foobar - { d2 d2 } >> + { d8 d d d d d d d } >> } diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index 695cb80b6e..7ef972ec27 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -160,10 +160,8 @@ Beam::quanting (SCM smob, SCM posns) Real xr = fvs ? lvs->relative_coordinate (common[X_AXIS], X_AXIS) : 0.0; /* - We store some info to quickly interpolate. - - Sometimes my head is screwed on backwards. The stemlength are - AFFINE linear in YL and YR. If YL == YR == 0, then we might have + We store some info to quickly interpolate. The stemlength are + affine linear in YL and YR. If YL == YR == 0, then we might have stem_y != 0.0, when we're cross staff. */ @@ -179,11 +177,18 @@ Beam::quanting (SCM smob, SCM posns) bool f = to_boolean (s->get_property ("french-beaming")) && s != lvs && s != fvs; - base_lengths.push_back (calc_stem_y (me, s, common, xl, xr, - Interval (0, 0), f) / ss); + if (Stem::is_normal_stem (s)) + { + base_lengths.push_back (calc_stem_y (me, s, common, xl, xr, + Interval (0, 0), f) / ss); + } + else + { + base_lengths.push_back (0); + } + stem_xposns.push_back (s->relative_coordinate (common[X_AXIS], X_AXIS)); } - bool xstaff = false; if (lvs && fvs) { @@ -348,7 +353,7 @@ Beam::score_stem_lengths (vector const &stems, for (vsize i = 0; i < stems.size (); i++) { Grob *s = stems[i]; - if (Stem::is_invisible (s)) + if (!Stem::is_normal_stem (s)) continue; Real x = stem_xs[i]; diff --git a/lily/stem.cc b/lily/stem.cc index dc7c82e91b..857dfb7d49 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -557,13 +557,11 @@ SCM Stem::height (SCM smob) { Grob *me = unsmob_grob (smob); - + if (!is_normal_stem (me)) + return ly_interval2scm (Interval ()); + Direction dir = get_grob_direction (me); - /* Trigger callback. - - UGH. Should be automatic - */ Grob *beam = get_beam (me); if (beam) { @@ -910,10 +908,14 @@ Stem::calc_stem_info (SCM smob) Real height_of_my_trem = 0.0; Grob *trem = unsmob_grob (me->get_object ("tremolo-flag")); if (trem) - height_of_my_trem = trem->extent (trem, Y_AXIS).length () + { + height_of_my_trem + = Stem_tremolo::vertical_length (trem) /* hack a bit of space around the trem. */ + beam_translation; + } + /* UGH It seems that also for ideal minimum length, we must use the maximum beam count (for this direction): -- 2.39.5