lilypond-devel
[Top][All Lists]
Advanced

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

Re: X-aligning on Y-parent - ?? advice needed


From: Han-Wen Nienhuys
Subject: Re: X-aligning on Y-parent - ?? advice needed
Date: Thu, 4 Apr 2013 10:48:17 +0200

I think this is because these are texts that are attached to multimeasure rests. The multi measure rest is the Y parent of the text. IIRC, the texts are implemented as spanners, so their X parent would be the left bound of the text spanner. 


On Tue, Apr 2, 2013 at 10:55 PM, Janek Warchoł <address@hidden> wrote:
Hi,

In scm/define-grobs.scm we can see that the following grobs:
MultiMeasureRestNumber
MultiMeasureRestText
PercentRepeatCounter
DoublePercentRepeatCounter
have their X-offsets initialized to a sum of return values from two
functions: x-aligned-on-self and x-centered-on-y-parent.  Now, the
x-aligned-on-self is quite clear, but i'm puzzled by
x-centered-on-y-parent: why would we derive grob's horizontal position
from its *vertical* parent?? Isn't it the job of horizontal parent to
be the base for horizontal position?  In other words, if
MultiMeasureRestNumber's Y-parent (which is a MultiMeasureRest) should
be the basis for MultiMeasureRestNumber's X-placement, then maybe we
should simply set MultiMeasureRestNumber's X-parent to be that
MultiMeasureRest?

I tried git archeology to learn about the motivation of this design,
but i didn't get anything meaningful - the only thing i know is that
Han-Wen wrote that code ;) so i'm ccing him.

I did some testing and it seems that my idea is correct (i.e. we
should just set appropriate X-parent and use that for alignment), but
i don't know how to set that parent - the obvious way failed... Check
out attached patch, and the testfile.  Ideas?

cheers,
Janek



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

reply via email to

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