]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/beam.cc (get_default_dir): robustness: don't divide by zero.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 28 Dec 2005 13:14:40 +0000 (13:14 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Wed, 28 Dec 2005 13:14:40 +0000 (13:14 +0000)
* lily/tuplet-bracket.cc (calc_control_points): oops: typo. Read
connect-to-neighbor property not connect-to-other

ChangeLog
lily/beam.cc
lily/tuplet-bracket.cc

index aa83af8a815fcab111455a77c3960b75f53500c4..4b5e9b57a0314161e18184c6573b548412afce74 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2005-12-28  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * lily/beam.cc (get_default_dir): robustness: don't divide by zero.
+
+       * lily/tuplet-bracket.cc (calc_control_points): oops: typo. Read
+       connect-to-neighbor property not connect-to-other
+
        * lily/program-option.cc (LY_DEFINE): remove Protected_scm global variable.
        (LY_DEFINE): oops. don't forget protection.
 
index b25a48ada569b9b115fd618b43aa30fa2d1b666b..5e650fa5463c06ffab8d02a3cf590fc74ab23948 100644 (file)
@@ -545,12 +545,14 @@ Beam::get_default_dir (Grob *me)
     }
 
   Direction dir = CENTER;
-  
-  if (Direction d =  (Direction) sign (count[UP] - count[DOWN]))
+  Direction d = CENTER;
+  if ((d = (Direction) sign (count[UP] - count[DOWN])))
     dir = d;
-  else if (Direction d = (Direction)  sign (total[UP] / count[UP] - total[DOWN]/count[DOWN]))
+  else if (count[UP]
+          && count[DOWN]
+          && (d = (Direction)  sign (total[UP] / count[UP] - total[DOWN]/count[DOWN])))
     dir = d;
-  else if (Direction d = (Direction)  sign (total[UP] - total[DOWN]))
+  else if ((d = (Direction)  sign (total[UP] - total[DOWN])))
     dir = d;
   else
     dir = to_dir (me->get_property ("neutral-direction"));
index d4a120ca5b15cbe4b7c4b89d4cd6a20c42e44fc3..defaed76092d242bf094a16909208707861af975 100644 (file)
@@ -186,7 +186,7 @@ Tuplet_bracket::calc_control_points (SCM smob)
   bounds[RIGHT] = get_x_bound_item (me, RIGHT, dir);
 
   Drul_array<bool> connect_to_other =
-    robust_scm2booldrul (me->get_property ("connect-to-other"),
+    robust_scm2booldrul (me->get_property ("connect-to-neighbor"),
                         Drul_array<bool> (false, false));
   
     
@@ -315,7 +315,7 @@ Tuplet_bracket::print (SCM smob)
       scale_drul (&shorten, ss);
 
       Drul_array<bool> connect_to_other =
-       robust_scm2booldrul (me->get_property ("connect-to-other"),
+       robust_scm2booldrul (me->get_property ("connect-to-neighbor"),
                             Drul_array<bool> (false, false));
 
       Direction d = LEFT;