On Sun, 2009-03-29 at 02:34 -0300, Han-Wen Nienhuys wrote: > On Sat, Mar 28, 2009 at 11:31 PM, Joe Neeman <[email protected]> wrote: > > > > The problem is that the current support for conditional accidentals is > > insufficient if there are multiple accidentals, not all of which are > > tied (see bug 612). The reason is that the positions of all the > > accidentals can change completely when an accidental is added or > > removed. So I think we need to run the whole layout algorithm twice, > > once with the conditional accidentals and once without, and I suggested > > that copying all of the accidentals is the simplest way to do it. I > > realize that this goes against the convention of only cloning items in > > the breakable columns, but I don't see another way to do it; the > > I am worried that this will lead to all kinds of other problems, when > other callbacks try to follow head -> accidental links, and screw up > because they end up at the wrong accidental object. Requesting note_head->accidental_grob before line-breaking is likely to be fragile anyway, because the accidental could always suicide...
> Is it not possible > to have accidental place calculate two sets of offsets, and add some > logic to make sure that the actual stencil and placement calculation > does not get triggered during line breaking? Then after the > linebreaking, one set of placements is used for positioning the > accidentals. Of course there will be some ugly hacks needed (similar > to the conditional skyline support) to extract the correct outline of > the accidentals during spacing/linebreaking. I'm not sure it would be easier, but it's worth checking out anyway. Chris, could you try adding Skyline Accidental_placement::conditional_skyline(Grob* me, Grob* left) ? This function would run the accidental layout algorithm on the correct (with respect to "left") set of accidentals but without actually calling translate_axis on the accidentals. Instead, it would just return the left_skyline that results from the accidental placement (ie, the value of left_skyline_ at accidental-placement.cc:391). Then add Skyline Accidental_placement::conditional_skyline(vector<Grob*> const& elts, Grob* left) which merges the results of conditional_skyline(me, left) for each me in elts. Finally, modify Separation_item::conditional_skyline to return this skyline. This should prevent any of the accidentals from being translated until after line-breaking. Sorry to ask you to re-implement what you've already done, but it could end up significantly cleaner if there are no complications. Joe _______________________________________________ lilypond-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-devel
