From e3de11d24da9da9f7bf3f0f5a879ae5c105708ae Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 14 Jul 2004 22:30:19 +0000 Subject: [PATCH] (score_slopes): strong sloping score only when stems point in same dir. --- lily/new-slur.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lily/new-slur.cc b/lily/new-slur.cc index 4a6234339f..92bfe99467 100644 --- a/lily/new-slur.cc +++ b/lily/new-slur.cc @@ -478,12 +478,14 @@ New_slur::score_slopes (Grob * me, Grob *common[], Drul_array base_atta Direction d = LEFT; Drul_array stem_dirs; + Drul_array beams; do { Grob *stem = Note_column::get_stem (extremes [d]); ys[d] = Stem::extremal_heads (stem)[Direction (dir)] ->relative_coordinate (common[Y_AXIS], Y_AXIS); stem_dirs[d] = get_grob_direction (stem); + beams[d] = Stem::get_beam (stem); } while (flip (&d) != LEFT); @@ -496,7 +498,7 @@ New_slur::score_slopes (Grob * me, Grob *common[], Drul_array base_atta Real demerit = 0.0; - if (stem_dirs[LEFT] == stem_dirs[RIGHT]) + if(! (beams[LEFT] || beams[RIGHT])) demerit += STEEPER_SLOPE_FACTOR * (dir * (fabs (slur_dy) - fabs (dy)) >? 0); if (sign (dy) == 0 && sign (slur_dy) != 0) @@ -508,7 +510,7 @@ New_slur::score_slopes (Grob * me, Grob *common[], Drul_array base_atta && sign (slur_dy) && sign (slur_dy) != sign (dy)) demerit += - (stem_dirs[LEFT] * stem_dirs[RIGHT] == -1) + (beams[LEFT] || beams[RIGHT]) ? SAME_SLOPE_PENALTY/10 : SAME_SLOPE_PENALTY; #if DEBUG_SLUR_QUANTING -- 2.39.5