--- /dev/null
+\version "2.15.9"
+
+\header {
+ texidoc = "Slur shaping is not adapted to accomodate objects
+towards the edges of slur. Said objects are thus ignored,
+which should make the slur in this regtest flat. Objects towards
+the edges are not, however, ignored in the slur scoring.
+"
+}
+
+\relative c {
+ \clef bass
+ c8( d' a d c, d' a d)
+ c,( des' as des c, des' as des) |
+}
Real extra_encompass_free_distance_;
Real absolute_closeness_measure_;
Real edge_slope_exponent_;
+ Real close_to_edge_length_;
Real head_slur_distance_max_ratio_;
Real head_slur_distance_factor_;
}
Real
-fit_factor (Offset dz_unit, Offset dz_perp,
+fit_factor (Offset dz_unit, Offset dz_perp, Real close_to_edge_length,
Bezier curve, Direction d, vector<Offset> const &avoid)
{
Real fit_factor = 0.0;
Offset p (dot_product (z, dz_unit),
d * dot_product (z, dz_perp));
+ bool close_to_edge = false;
+ Direction d = LEFT;
+ do
+ close_to_edge = close_to_edge || -d * (p[X_AXIS] - curve_xext[d]) < close_to_edge_length;
+ while (flip (&d) != LEFT);
+
+ if (close_to_edge)
+ continue;
+
Real eps = 0.01;
Interval pext = eps * Interval (-1, 1) + p[X_AXIS];
pext.intersect (curve_xext);
+
if (pext.is_empty () || pext.length () <= 1.999 * eps)
continue;
+ dz_unit * x2;
curve.control_[3] = attachment_[RIGHT];
- Real ff = fit_factor (dz_unit, dz_perp, curve, state.dir_, avoid);
+ Real ff = fit_factor (dz_unit, dz_perp, state.parameters_.close_to_edge_length_,
+ curve, state.dir_, avoid);
height = max (height, min (height * ff, max_h));
= get_detail (details, ly_symbol2scm ("free-slur-distance"));
edge_slope_exponent_
= get_detail (details, ly_symbol2scm ("edge-slope-exponent"));
+ close_to_edge_length_
+ = get_detail (details, ly_symbol2scm ("close-to-edge-length"));
}