]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/slur.cc
* lily/slur.cc (outside_slur_callback): epsilon-delta management
[lilypond.git] / lily / slur.cc
index 7be89976d8fe6db83b554eecc554255992f5ece5..2f83d045a3a07db6e8a69140886508c49db7f583 100644 (file)
@@ -169,8 +169,14 @@ Slur::outside_slur_callback (SCM grob, SCM axis)
   
   if (!bezext.contains (x))
     return scm_make_real (0);
-
-  Real y = curve.get_other_coordinate (X_AXIS, x);
+  Real dist = fabs (x - bezext[LEFT]) <? fabs (x - bezext[RIGHT]);
+  
+  Real y = (dist >  1e-3)
+    ? curve.get_other_coordinate (X_AXIS, x)
+    : ((x < bezext.center())
+       ? curve.control_[0][Y_AXIS]
+       : curve.control_[3][Y_AXIS]);
+       
   if (yext.contains (y)) 
     {
       Direction dir = get_grob_direction (script);