]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/beam.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / beam.cc
index b25a48ada569b9b115fd618b43aa30fa2d1b666b..cab9d8fdfc2a8cd34322864d529f2ba5ce35c5b3 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
 */
 
@@ -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"));