From f08a54b1e0294727032899c003bb48c9442a65ba Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Wed, 28 Dec 2005 13:14:40 +0000 Subject: [PATCH] * 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 --- ChangeLog | 5 +++++ lily/beam.cc | 10 ++++++---- lily/tuplet-bracket.cc | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa83af8a81..4b5e9b57a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-12-28 Han-Wen Nienhuys + * 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. diff --git a/lily/beam.cc b/lily/beam.cc index b25a48ada5..5e650fa546 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -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")); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index d4a120ca5b..defaed7609 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -186,7 +186,7 @@ Tuplet_bracket::calc_control_points (SCM smob) bounds[RIGHT] = get_x_bound_item (me, RIGHT, dir); Drul_array connect_to_other = - robust_scm2booldrul (me->get_property ("connect-to-other"), + robust_scm2booldrul (me->get_property ("connect-to-neighbor"), Drul_array (false, false)); @@ -315,7 +315,7 @@ Tuplet_bracket::print (SCM smob) scale_drul (&shorten, ss); Drul_array connect_to_other = - robust_scm2booldrul (me->get_property ("connect-to-other"), + robust_scm2booldrul (me->get_property ("connect-to-neighbor"), Drul_array (false, false)); Direction d = LEFT; -- 2.39.5