{
warning (_ ("Slur over rest?"));
o_[X_AXIS] = note_column->hpos_f ();
+ o_[Y_AXIS] = note_column->extent (Y_AXIS)[dir];
return;
}
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
{
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)))
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)
{
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.
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 <? abs (dy_f);
+ dy_f_drul_[d] += dir_ * damp_f;
}
/*
Avoid too high slurs
+
+ Wierd slurs may look a lot better after they have been
+ adjusted a bit.
+ So, we'll do this in 3 steps
*/
- ratio_f = abs (height_f / dx_f);
- if (ratio_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 <? abs (dy_f/2);
+ dy_f_drul_[d] += dir_ * damp_f;
+ }
}
}
slur_x_minimum = 3.0 * \interline;
% slope damping: keep dy/dx < slur_slope_damping
-slur_slope_damping = 0.3;
+slur_slope_damping = 0.35;
slur_interstaff_slope_damping = 0.8;
% height damping: keep h/dx < slur_height_damping
-slur_height_damping = 0.6;
-slur_interstaff_height_damping = 1.5;
+slur_height_damping = 0.45;
+slur_interstaff_height_damping = 1.2;
% snap to stem if slur ends closer to stem than
slur_snap_to_stem = 1.5 * \interline;
slur_interstaff_snap_to_stem = 2.5 * \interline;
non_musical_space_strength = 40.0;
-
+%If columns do not have spacing information set, set it to this much
+loose_column_distance = 2.0 * \interline;
\include "engraver.ly";