]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam-quanting.cc
*** empty log message ***
[lilypond.git] / lily / beam-quanting.cc
index d8d97cba92dd974781c594fe738e3c34194fa92c..fc4ff9810c9f59ec1949706fe128a05960f576fc 100644 (file)
@@ -19,7 +19,7 @@
 #include "staff-symbol-referencer.hh"
 #include "beam.hh"
 #include "stem.hh"
-#include "paper-def.hh"
+#include "output-def.hh"
 #include "group-interface.hh"
 #include "align-interface.hh"
 
@@ -110,7 +110,7 @@ Beam::quanting (SCM smob)
   Real slt = Staff_symbol_referencer::line_thickness (me) / ss;
 
   SCM sdy = me->get_property ("least-squares-dy");
-  Real dy_mus = is_number (sdy) ? ly_scm2double (sdy) : 0.0;
+  Real dy_mus = ly_c_number_p (sdy) ? ly_scm2double (sdy) : 0.0;
   
   Real straddle = 0.0;
   Real sit = (thickness - slt) / 2;
@@ -282,7 +282,7 @@ Beam::quanting (SCM smob)
 #if DEBUG_QUANTING
   SCM inspect_quants = me->get_property ("inspect-quants");
   if (debug_beam_quanting_flag
-      && is_pair (inspect_quants))
+      && ly_c_pair_p (inspect_quants))
     {
       Drul_array<Real> ins = ly_scm2interval (inspect_quants);
 
@@ -476,8 +476,15 @@ Beam::score_forbidden_quants (Real yl, Real yr,
            This test is too weak; we should really check all lines.
           */
          Direction stem_dir = dirs[d];
-         Real gap1 =  y[d] - stem_dir * ((j-1) * beam_translation + thickness / 2 - slt/2 );
-         Real gap2 = y[d] - stem_dir * (j * beam_translation - thickness / 2 + slt/2);
+
+         /*
+           The 2.2 factor is to provide a little leniency for
+           borderline cases. If we do 2.0, then the upper outer line
+           will be in the gap of the (2,sit) quant, leading to a
+           false demerit.
+          */
+         Real gap1 =  y[d] - stem_dir * ((j-1) * beam_translation + thickness / 2 - slt/2.2 );
+         Real gap2 = y[d] - stem_dir * (j * beam_translation - thickness / 2 + slt/2.2);
 
          Interval gap;
          gap.add_point (gap1);