+ Wierd slurs may look a lot better after they have been
+ adjusted a bit.
+ So, we'll do this in 3 steps
+ */
+ for (int i = 0; i < 3; i++)
+ {
+ Drul_array<Interval> curve_xy_drul = curve_extent_drul ();
+ Real height_f = curve_xy_drul[Y].length ();
+ Real width_f = curve_xy_drul[X].length ();
+
+ dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
+ if (!fix_broken_b)
+ dy_f -= interstaff_f;
+
+ Real height_ratio_f = abs (height_f / width_f);
+ if (height_ratio_f > height_damp_f)
+ {
+ Direction d = (Direction)(- get_direction () * (sign (dy_f)));
+ if (!d)
+ d = LEFT;
+ /* take third step */
+ Real damp_f = (height_ratio_f - height_damp_f) * width_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] += get_direction () * damp_f;
+ dy_f_drul_[d] += get_direction () * 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] += get_direction () * damp_f;
+ }
+ }
+ }