[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
breaking beams into flags
From: |
Han-Wen Nienhuys |
Subject: |
breaking beams into flags |
Date: |
Fri, 7 Dec 2001 17:01:48 +0100 |
address@hidden writes:
> It is a serious limitation that it is so hard to specify breakpoints of beams.
> I would like a command to say that "no beams can cross this point".
> Or at least that [c8] results in a flagged c instead of something unusable (c
> wih neither beam nor flag).
--- beam.cc~ Sat Dec 1 15:34:56 2001
+++ beam.cc Fri Dec 7 16:59:49 2001
@@ -78,14 +78,35 @@
{
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)
{
--
Han-Wen Nienhuys | address@hidden | http://www.cs.uu.nl/~hanwen/