Reviewers: ,

Message:
This is much shorter than my previous work on this issue and is in the
spirit of Han-Wen's 6c6ae92410f087d0318a3c302eb6877cfc7fae45.
fit_factor only makes sense when applied to the middle of curves (what
we can consider their steady states).  Near their attachments (what
could be called their "transients"), there is a lot of volatility
because the way they look and the avoidance obstacles they face are of a
different order.

Instead of defining the middle of curve in terms of curve length, I use
a constant number here.  It seems to do the trick better than a variable
length.

This fixes Issue 163 and only changes one regtest (for the better, I
think).

Cheers,
MS

Description:
Fixes bad slur heights by limiting fit_factor to the interior of slurs.

Please review this at http://codereview.appspot.com/4810072/

Affected files:
  M lily/slur-configuration.cc


Index: lily/slur-configuration.cc
diff --git a/lily/slur-configuration.cc b/lily/slur-configuration.cc
index 8fdea86edb73b0a1fb4829e0a4fcf39932828a8f..083fc5935df3b626ea9a13a7207354f8497a13a2 100644
--- a/lily/slur-configuration.cc
+++ b/lily/slur-configuration.cc
@@ -95,7 +95,10 @@ fit_factor (Offset dz_unit, Offset dz_perp,
       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)
+      if ((pext.is_empty ()
+          || pext.length () <= 1.999 * eps
+          || (p[X_AXIS] - curve_xext[LEFT])  < 2.5
+          || (curve_xext[RIGHT] - p[X_AXIS]) < 2.5))
         continue;

       Real y = curve.get_other_coordinate (X_AXIS, p[X_AXIS]);



_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to