]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/beam-concave.cc (calc_concaveness): take absolute value of
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 22 Sep 2004 16:12:36 +0000 (16:12 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 22 Sep 2004 16:12:36 +0000 (16:12 +0000)
dy for scaling. This fixes various downbeams.

* lily/beam-quanting.cc (best_quant_score_idx):

ChangeLog
lily/beam-concave.cc
lily/beam-quanting.cc

index 8efee7fa34badf6ac95e5ffd558ced4d4654f3de..741fc100e76b6be31bbbef82b189700b632e1eac 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2004-09-22  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/beam-concave.cc (calc_concaveness): take absolute value of
+       dy for scaling. This fixes various downbeams.
+       
+
+       * lily/beam-quanting.cc (best_quant_score_idx): 
+
 2004-09-22  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * scm/framework-tex.scm (header-to-file): Fix.
index 22cfbb945c14698d7fed4dd54a3e3521a7711c44..07d0e3b335a2d7c300dc9b76a2ac098dad8db472 100644 (file)
@@ -80,7 +80,7 @@ calc_concaveness (Array<int> const &positions, Direction beam_dir)
     scaling of concaveness doesn't matter much.
   */
   if (dy)
-    concaveness /= dy;
+    concaveness /= fabs (dy);
   return concaveness;
 }
 
index 7dea6076607d517768031ee812942c5d2e512e48..00375335a8dfd4d4c0e01f8cec7388b9d7912f29 100644 (file)
@@ -70,7 +70,8 @@ struct Quant_score
 
 */
 
-int best_quant_score_idx (Array<Quant_score>  const & qscores)
+int
+best_quant_score_idx (Array<Quant_score>  const & qscores)
 {
   Real best = 1e6;
   int best_idx = -1;
@@ -83,6 +84,13 @@ int best_quant_score_idx (Array<Quant_score>  const & qscores)
        }
     }
 
+  if (best_idx < 0)
+    {
+      programming_error ("Huh? No best beam quant score?");
+      best_idx = 0;
+    }
+  
+    
   return best_idx;
 }
   
@@ -275,7 +283,6 @@ Beam::quanting (SCM smob)
 
   int best_idx = best_quant_score_idx (qscores);
 
-
 #if DEBUG_QUANTING
   SCM inspect_quants = me->get_property ("inspect-quants");
   if (to_boolean (me->get_paper ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting")))