From deddd76b92c89ccfff9243a937398b4444ccb098 Mon Sep 17 00:00:00 2001 From: hanwen Date: Thu, 4 Aug 2005 15:57:47 +0000 Subject: [PATCH] (shift_region_to_valid): prevent division by zero. Fixes beams across line breaks with 1 stem after the break. --- ChangeLog | 7 ++++++- lily/beam.cc | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7393877f33..2b701e16de 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2005-08-04 Han-Wen Nienhuys - + + * lily/beam.cc (shift_region_to_valid): prevent division by + zero. Fixes beams across line breaks with 1 stem after the break. + + * VERSION: release 2.6.3 + * lily/auto-beam-engraver.cc (derived_mark): new method. Yes. We have to protect even those unlikely-to-be-corrupted data members. diff --git a/lily/beam.cc b/lily/beam.cc index 868470c3b5..2a7c04d78f 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -946,7 +946,7 @@ Beam::shift_region_to_valid (SCM grob) Real dy = pos[RIGHT] - pos[LEFT]; Real y = pos[LEFT]; - Real slope = dy / dx; + Real slope = dx ? dy / dx : 0.0; /* Shift the positions so that we have a chance of finding good -- 2.39.5