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

2013-04-08 Thread Janek Warchoł
hi,

2013/4/5 Janek Warchoł :
> 2013/4/5 Neil Puttock :
>> On 5 April 2013 17:47, Janek Warchoł  wrote:
>>
>>> Regardless of it being a spanner, i've tried to find where
>>> MultiMeasureRestText's (and MultiMeasureRestNumber's) Xparent is set,
>>> but without sucsess.  I thought that maybe it happens in line 240 of
>>> paper-column-engraver, but apparently not.
>>
>> Spanner:set_bound ()
>
> Ah!  Thanks a lot, that set me back on track.
> From my tests it seems that there is no need to reset X-parent of
> MMRtexts, MMRnumbers and PercentRepeatCounters in this place - if we
> let them continue to be what they were set to using previous patch
> (i.e.  MMRs/PercentRepeat), everything seems to be fine.  What do you
> think about it?  (a draft patch is attached - my tests say that it
> doesn't change anything in regtests).

after some more thinking i believe that this is a reasonable way to
go.  I've added this as a first commit (cce7fefdbc1) on branch
dev/janek-alignment, and it's also visible in
https://codereview.appspot.com/7768043/ (although that issue is pretty
messy).

best,
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


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

2013-04-05 Thread Janek Warchoł
Hi,

2013/4/5 Han-Wen Nienhuys :
>
> On Thu, Apr 4, 2013 at 7:01 PM, Janek Warchoł 
> wrote:
>> It is obvious that MultiMeasureRest itself should be a spanner, but
>> its number is just a text, an item with a fixed width.  Why should it
>> be a spanner?
>
> They have to be spanners - if the mm rest is broken across a linebreak, the
> text should be too.

Do you mean a situation like this?

\score {
  <<
{ s1*3 \break s1*5 }
{ R1*8^"foo!foo!" }
  >>
  \layout {
\compressFullBarRests
  }
}


2013/4/5 Neil Puttock :
> On 5 April 2013 17:47, Janek Warchoł  wrote:
>
>> Regardless of it being a spanner, i've tried to find where
>> MultiMeasureRestText's (and MultiMeasureRestNumber's) Xparent is set,
>> but without sucsess.  I thought that maybe it happens in line 240 of
>> paper-column-engraver, but apparently not.
>
> Spanner:set_bound ()

Ah!  Thanks a lot, that set me back on track.
>From my tests it seems that there is no need to reset X-parent of
MMRtexts, MMRnumbers and PercentRepeatCounters in this place - if we
let them continue to be what they were set to using previous patch
(i.e.  MMRs/PercentRepeat), everything seems to be fine.  What do you
think about it?  (a draft patch is attached - my tests say that it
doesn't change anything in regtests).

best,
Janek


0001-set-X-parents-of-MMRest-numbers-and-PercRep.-correct.patch
Description: Binary data


0002-don-t-reset-X-parents-of-MMRtexts-numbers-and-Percen.patch
Description: Binary data
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


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

2013-04-05 Thread Neil Puttock
On 5 April 2013 17:47, Janek Warchoł  wrote:

Regardless of it being a spanner, i've tried to find where
> MultiMeasureRestText's (and MultiMeasureRestNumber's) Xparent is set,
> but without sucsess.  I thought that maybe it happens in line 240 of
> paper-column-engraver, but apparently not.


Spanner:set_bound ()

Cheers,
Neil
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


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

2013-04-05 Thread Han-Wen Nienhuys
They have to be spanners - if the mm rest is broken across a linebreak, the
text should be too.


On Thu, Apr 4, 2013 at 7:01 PM, Janek Warchoł wrote:

> Hi Han-Wen,
>
> On Thu, Apr 4, 2013 at 10:48 AM, Han-Wen Nienhuys 
> wrote:
> > 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.
>
> Indeed it seems that this is the case, but i don't see any sense in it.
> It is obvious that MultiMeasureRest itself should be a spanner, but
> its number is just a text, an item with a fixed width.  Why should it
> be a spanner?
> I've traced this code back to commit 0d239922, which introduces
> separate grob for MMRnumbers, and i found no explanation why it should
> be a spanner.
> I've tried changing them to be Items, but all i got was a segfault (my
> attempt attached).
> Suggestions?
>
> Janek
>



-- 
Han-Wen Nienhuys - han...@xs4all.nl - http://www.xs4all.nl/~hanwen
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


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

2013-04-05 Thread Janek Warchoł
2013/4/4 Janek Warchoł :
> Hi Han-Wen,
>
> On Thu, Apr 4, 2013 at 10:48 AM, Han-Wen Nienhuys  wrote:
>> 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.
>
> Indeed it seems that this is the case, but i don't see any sense in it.
> It is obvious that MultiMeasureRest itself should be a spanner, but
> its number is just a text, an item with a fixed width.  Why should it
> be a spanner?

Regardless of it being a spanner, i've tried to find where
MultiMeasureRestText's (and MultiMeasureRestNumber's) Xparent is set,
but without sucsess.  I thought that maybe it happens in line 240 of
paper-column-engraver, but apparently not.
I don't know what to do with this.  As i see it, there's something
wrong; it's unclear what happens to these grobs and why they couldn't
have MultiMeasureRests as Xparents, but i don't know how to fix it
because i don't understand what's happening.
Maybe you could give me some pointers?
thanks,
Janek

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


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

2013-04-04 Thread Janek Warchoł
Hi Han-Wen,

On Thu, Apr 4, 2013 at 10:48 AM, Han-Wen Nienhuys  wrote:
> 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.

Indeed it seems that this is the case, but i don't see any sense in it.
It is obvious that MultiMeasureRest itself should be a spanner, but
its number is just a text, an item with a fixed width.  Why should it
be a spanner?
I've traced this code back to commit 0d239922, which introduces
separate grob for MMRnumbers, and i found no explanation why it should
be a spanner.
I've tried changing them to be Items, but all i got was a segfault (my
attempt attached).
Suggestions?

Janek


0001-try-to-change-MMRnumbers-to-items-from-spanners.patch
Description: Binary data
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


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

2013-04-04 Thread Han-Wen Nienhuys
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ł 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 - han...@xs4all.nl - http://www.xs4all.nl/~hanwen
___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel