From 2c646cd4ceca5e7db5741dd008d1a3245a08101d Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 22:23:49 +0000 Subject: [PATCH] lilypond-1.1.60 --- lily/colhpos.cc | 2 +- lily/encompass-info.cc | 8 +++++- lily/slur.cc | 65 ++++++++++++++++++++++++++++-------------- ly/params.ly | 9 +++--- 4 files changed, 56 insertions(+), 28 deletions(-) diff --git a/lily/colhpos.cc b/lily/colhpos.cc index 8d82c2c06d..f23646cb01 100644 --- a/lily/colhpos.cc +++ b/lily/colhpos.cc @@ -45,7 +45,7 @@ void Column_x_positions::OK() const { #ifndef NDEBUG - assert (config.size() == cols.size ()); + assert (config_.size() == cols_.size ()); #endif } diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc index b5fbcf56fe..323fc20a9c 100644 --- a/lily/encompass-info.cc +++ b/lily/encompass-info.cc @@ -31,6 +31,7 @@ Encompass_info::Encompass_info (Note_column const* note_column, Direction dir, S { warning (_ ("Slur over rest?")); o_[X_AXIS] = note_column->hpos_f (); + o_[Y_AXIS] = note_column->extent (Y_AXIS)[dir]; return; } @@ -42,9 +43,14 @@ Encompass_info::Encompass_info (Note_column const* note_column, Direction dir, S o_[X_AXIS] -= 0.5 * stem_l->dir_ * note_column->extent (X_AXIS).length (); - if (stem_l->dir_ == dir) + if ((stem_l->dir_ == dir) + && !stem_l->extent (Y_AXIS).empty_b ()) { o_[Y_AXIS] = stem_l->extent (Y_AXIS)[dir]; + // URG URG. + // some slur in choral.ly returns -inf here + if (abs (o_[Y_AXIS]) > 1000) + o_[Y_AXIS] = 0; } else { diff --git a/lily/slur.cc b/lily/slur.cc index 5e8055a9f4..474712e8d5 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -134,7 +134,7 @@ Slur::do_post_processing () side directly attached to note head; no beam getting in the way */ - if (((stem_l->get_elt_property (transparent_scm_sym) != SCM_BOOL_F) + if ((stem_l->extent (Y_AXIS).empty_b () || !((stem_l->dir_ == dir_) && (dir_ != d))) && !((dir_ == stem_l->dir_) && stem_l->beam_l_ && (stem_l->beams_i_drul_[-d] >= 1))) @@ -241,14 +241,6 @@ Slur::do_post_processing () Real height_damp_f; Real slope_damp_f; Real snap_f; - Real ratio_f; - - if (!fix_broken_b) - dy_f_drul_[RIGHT] += interstaff_f; - Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]; - - Real dx_f = do_width ().length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]; - Real height_f = do_height ().length (); if (!interstaff_b) { @@ -263,6 +255,11 @@ Slur::do_post_processing () snap_f = paper_l ()->get_var ("slur_interstaff_snap_to_stem"); } + Real ratio_f; + if (!fix_broken_b) + dy_f_drul_[RIGHT] += interstaff_f; + Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]; + Real dx_f = do_width ().length () + dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]; /* Avoid too steep slurs. @@ -273,26 +270,50 @@ Slur::do_post_processing () Direction d = (Direction)(- dir_ * (sign (dy_f))); if (!d) d = LEFT; - dy_f_drul_[d] += dir_ * (ratio_f - slope_damp_f) * dx_f; + Real damp_f = (ratio_f - slope_damp_f) * dx_f; + /* + must never change sign of dy + */ + damp_f = damp_f height_damp_f) + for (int i = 0; i < 3; i++) { - Direction d = (Direction)(- dir_ * (sign (dy_f))); - if (!d) - d = LEFT; - Real damp_f = dir_ * (ratio_f - height_damp_f) * dx_f; - dy_f_drul_[d] += damp_f; - /* - if y positions at about the same height, correct both ends - */ - if (abs (dy_f / dx_f ) < slope_damp_f) + Real height_f = do_height ().length (); + dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT]; + + ratio_f = abs (height_f / dx_f); + if (ratio_f > height_damp_f) { - dy_f_drul_[-d] += damp_f; + Direction d = (Direction)(- dir_ * (sign (dy_f))); + if (!d) + d = LEFT; + /* take third step */ + Real damp_f = (ratio_f - height_damp_f) * dx_f / 3; + /* + if y positions at about the same height, correct both ends + */ + if (abs (dy_f / dx_f ) < slope_damp_f) + { + dy_f_drul_[-d] += dir_ * damp_f; + dy_f_drul_[d] += dir_ * damp_f; + } + /* + don't change slope too much, would have been catched by slope damping + */ + else + { + damp_f = damp_f