lilypond-devel
[Top][All Lists]
Advanced

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

Re: [trivial patch] fix bracket padding


From: Valentin Villenave
Subject: Re: [trivial patch] fix bracket padding
Date: Thu, 16 Jul 2009 11:38:12 +0200

2009/7/9 Graham Percival <address@hidden>:
> Since this contains a patch, I forward it to lilypond-devel.  Does
> anybody think it looks reasonable?
>
>
> On Mon, Jul 06, 2009 at 11:08:42PM +0000, Thomas Morgan wrote:
>> Consider this input:
>>
>>   \version "2.13.2"
>>   \markup {
>>     \column {
>>       \concat { "a" \bracket { "b" } "c" }
>>       "abc"                                   % For comparison.
>>     }
>>   }
>>
>> The right bracket's padding causes the following "c" to move out
>> of the way of the bracket.  But the left bracket's padding does not
>> prevent the "a" and the left bracket from colliding.
>>
>> Is this a bug?  If so, it could be fixed by the following patch.
>>
>> (I also switched `lb' and `rb' having noticed that `lb' was actually
>> the right bracket and `rb' was the left bracket.)
>>
>> diff --git a/scm/stencil.scm b/scm/stencil.scm
>> index 105f6f5..fcf5434 100644
>> --- a/scm/stencil.scm
>> +++ b/scm/stencil.scm
>> @@ -62,12 +62,12 @@
>>    "Add brackets around STIL, producing a new stencil."
>>
>>    (let* ((ext (ly:stencil-extent stil axis))
>> -      (lb (ly:bracket axis ext thick (- protusion)))
>> -      (rb (ly:bracket axis ext thick protusion)))
>> +      (lb (ly:bracket axis ext thick protusion))
>> +      (rb (ly:bracket axis ext thick (- protusion))))
>>      (set! stil
>> -       (ly:stencil-combine-at-edge stil (other-axis axis) 1 lb padding))
>> +       (ly:stencil-combine-at-edge stil (other-axis axis) 1 rb padding))
>>      (set! stil
>> -       (ly:stencil-combine-at-edge stil (other-axis axis) -1 rb padding))
>> +       (ly:stencil-combine-at-edge lb (other-axis axis) 1 stil padding))
>>      stil))
>>
>>  (define-public (make-line-stencil width startx starty endx endy)

Although it mostly LGTM, I am in no position to merge it on my own.
So, it's now added as #807 in our tracker.

(and the lb/rb thing looks weird indeed, if I may)

Regards,
Valentin




reply via email to

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