Hi,

On Fri, Aug 21, 2015 at 2:37 PM, David Kastrup <d...@gnu.org> wrote:

> tisimst <tisimst.lilyp...@gmail.com> writes:
>
> > On 8/21/2015 5:40 AM, Andrew Bernard [via Lilypond] wrote:
> There was one oddity I encountered in the process, though. When I
> > irregularized the flags, I noticed that a flag is printed for EVERY note
> > within the same chord! Crazy, I know. Sounds like an unnecessary thing
> > if you ask me.
>
> Sounds like an undiscovered bug if you ask me.
>

Yes, I think so.

It appears that there is no provision for redundant flags in Flag::print.

The attached is a diff for a quick test fix.  Only one of the flags is
actually pointed to by Stem.flag, and we keep it, suiciding the others.
Don't know if that's adequate.

You can compare the results with and without using this:

 \version "2.19"

{
  \override Flag.after-line-breaking =
  #(lambda (grob)
     (let* ((refp (ly:grob-system grob))
            (elts (ly:grob-array->list (ly:grob-object refp
'all-elements)))
            (me-in-list (let loop ((elts elts) (x 0))
                          (if (or (not (pair? elts))
                                  (eq? (car elts) grob))
                              x
                              (loop (cdr elts) (1+ x))))))
       (set! (ly:grob-property grob 'stencil)
             (ly:stencil-translate-axis
        (ly:flag::print grob)
        (/ me-in-list -1.5)
        Y))))
  <c'' e''>8
  \noBeam
  <c'' e''>8
  <c'' e'' g'' bes''>32
}


It will separate flag copies.

David
From 720b2a7bd29334c1ecb9348c024a381d11253768 Mon Sep 17 00:00:00 2001
From: David Nalesnik <david.nales...@gmail.com>
Date: Fri, 21 Aug 2015 17:02:13 -0500
Subject: [PATCH] Suicide extra flags

---
 lily/flag.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lily/flag.cc b/lily/flag.cc
index 4b90be8..0f5b011 100644
--- a/lily/flag.cc
+++ b/lily/flag.cc
@@ -115,6 +115,12 @@ Flag::print (SCM smob)
   Grob *me = unsmob<Grob> (smob);
   Grob *stem = me->get_parent (X_AXIS);
 
+  if (me != unsmob<Grob> (stem->get_object ("flag")))
+    {
+      me->suicide ();
+      return SCM_EOL;
+    }
+
   Direction d = get_grob_direction (stem);
   string flag_style;
 
-- 
1.9.1

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to