lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange loop executed only once!


From: Han-Wen Nienhuys
Subject: Re: Strange loop executed only once!
Date: Sun, 22 Apr 2012 08:28:20 -0300

On Sun, Apr 22, 2012 at 7:20 AM, Łukasz Czerwiński <address@hidden> wrote:
> Hi,
>
> I have spotted a strange loop in lily/ledger-line-spanner.cc (lines 46-69):
>
> Direction d = UP;
>   do
>     {
>       .............
>     }
>   while (flip (&d) != DOWN);
>
> It will be executed only once - with d set to UP. To be executed for d = UP
> and then d = DOWN, it should be:
> while (flip (&d) != UP);
>
> Could someone take a look at this?


Looks like a bug.  Maybe you could work on a test/repro case? I think
it will trigger if you have noteheads with ledgers very closely spaced
under the staff (the code is to enforce a minimum distance so the
ledger lines remain visible).

this also looks a little suspect:

          Real total_head_length = previous_extents[d].length ()
                                   + current_extents[d].length ();

I would expect that it should add

  current[d][RIGHT] - previous[d][LEFT]

perhaps this will set rods too large if you have lots of ledgered
chords with seconds in them, in a tight spacing configuration.

-- 
Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen



reply via email to

[Prev in Thread] Current Thread [Next in Thread]