From: fred Date: Wed, 27 Mar 2002 02:04:38 +0000 (+0000) Subject: lilypond-1.5.26 X-Git-Tag: release/1.5.59~379 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=25498055c854f0576647dfd6dd4198bfc606f842;p=lilypond.git lilypond-1.5.26 --- diff --git a/lily/beam.cc b/lily/beam.cc index 8bedaa22af..1c0ed8e545 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -78,14 +78,35 @@ Beam::before_line_breaking (SCM smob) { Grob * me = unsmob_grob (smob); - // Why? /* - Why what? Why the warning (beams with less than 2 stems are - degenerate beams, should never happen), or why would this ever - happen (don't know). */ + Beams with less than 2 two stems don't make much sense, but could happen + when you do + + [r8 c8 r8]. + + For a beam that only has one stem, we try to do some disappearance magic: + we revert the flag, and move on to The Eternal Engraving Fields.*/ + + if (visible_stem_count (me) < 2) { - warning (_ ("beam has less than two stems")); + warning (_ ("beam has less than two visible stems")); + + SCM stems = me->get_grob_property ("stems"); + if (scm_ilength (stems) == 1) + { + warning (_("Beam has less than two stems. Removing beam.")); + + unsmob_grob (gh_car (stems))->remove_grob_property ("beam"); + me->suicide (); + + return SCM_UNSPECIFIED; + } + else if (scm_ilength (stems) == 0) + { + me->suicide (); + return SCM_UNSPECIFIED; + } } if (visible_stem_count (me) >= 1) {