lilypond-devel
[Top][All Lists]
Advanced

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

Re: Changes the Y offset callback of multi-measure rest. (issue4389047)


From: address@hidden
Subject: Re: Changes the Y offset callback of multi-measure rest. (issue4389047)
Date: Tue, 12 Apr 2011 06:17:02 -0400

On Apr 12, 2011, at 12:53 AM, Colin Campbell wrote:

> On 11-04-11 05:11 PM, address@hidden wrote:
>> Reviewers: ,
>> 
>> Message:
>> I was able to figure out a way to do this w/o an extra offset (I think).
>> Please, read, test, & report back.
>> 
>> Cheers,
>> MS
>> 
>> Description:
>> Changes the Y offset callback of multi-measure rest.
>> 
>> Please review this at http://codereview.appspot.com/4389047/
>> 
>> Affected files:
>>  A input/regression/multi-measure-rest-y-offset.ly
>>  M lily/multi-measure-rest.cc
>>  M scm/define-grobs.scm
>>  M scm/output-lib.scm
>> 
>> 
>> Index: input/regression/multi-measure-rest-y-offset.ly
>> diff --git a/input/regression/multi-measure-rest-y-offset.ly 
>> b/input/regression/multi-measure-rest-y-offset.ly
>> new file mode 100644
>> index 
>> 0000000000000000000000000000000000000000..480d5731cbdff96f1f8fafdb2b72a22c60393461
>> --- /dev/null
>> +++ b/input/regression/multi-measure-rest-y-offset.ly
>> @@ -0,0 +1,15 @@
>> +\version "2.13.60"
>> +\header {
>> +  texidoc = "The multi-measure rest's automatic vertical shifting can
>> +be turned off with the automatic-shift property."
>> +}
>> +
>> +\paper {
>> +  ragged-right = ##t
>> +}
>> +
>> +\relative c' {
>> +  R1
>> +  \override Staff . MultiMeasureRest #'Y-offset = #0
>> +  R1
>> +}
>> \ No newline at end of file
>> Index: lily/multi-measure-rest.cc
>> diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc
>> index 
>> 9628402a5ecec1ce899d4ef1d4ea57002b7529af..4e3a32f50c2fedec4f6795810cd4048ad3f10912
>>  100644
>> --- a/lily/multi-measure-rest.cc
>> +++ b/lily/multi-measure-rest.cc
>> @@ -137,8 +137,6 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
>>       return s;
>>     }
>> 
>> -  Real staff_space = Staff_symbol_referencer::staff_space (me);
>> -
>>   Font_metric *musfont = Font_interface::get_default_font (me);
>> 
>>   SCM sml = me->get_property ("use-breve-rest");
>> @@ -156,12 +154,6 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real 
>> space)
>>     {
>>       Stencil s = musfont->find_by_name (Rest::glyph_name (me, 0, "", true));
>> 
>> -      /*
>> -        ugh.
>> -      */
>> -      if (Staff_symbol_referencer::get_position (me) == 0.0)
>> -        s.translate_axis (staff_space, Y_AXIS);
>> -
>>       s.translate_axis ((space - s.extent (X_AXIS).length ()) / 2, X_AXIS);
>> 
>>       return s;
>> Index: scm/define-grobs.scm
>> diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm
>> index 
>> 84c3f72f8fbb72c715ebab652bd81c2780b31998..a167659ed264a61402318c060e768bac38b2f7d9
>>  100644
>> --- a/scm/define-grobs.scm
>> +++ b/scm/define-grobs.scm
>> @@ -1309,7 +1309,7 @@
>>     (staff-position . 0)
>>     (stencil . ,ly:multi-measure-rest::print)
>>     (thick-thickness . 6.6)
>> -    (Y-offset . ,ly:staff-symbol-referencer::callback)
>> +    (Y-offset . ,multi-measure-rest::callback)
>>     (meta . ((class . Spanner)
>>          (interfaces . (font-interface
>>                 multi-measure-interface
>> Index: scm/output-lib.scm
>> diff --git a/scm/output-lib.scm b/scm/output-lib.scm
>> index 
>> 27c69fdfbe82eba10f1d3dcc20fe8156863c0926..1c2da4e7234c6835770934c74659d8dc7f876d3c
>>  100644
>> --- a/scm/output-lib.scm
>> +++ b/scm/output-lib.scm
>> @@ -780,6 +780,15 @@ between the two text elements."
>> 
>> 
>> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> +;; multi-measure-rest
>> +
>> +(define-public (multi-measure-rest::callback grob)
>> +  (let ((y-offset (ly:staff-symbol-referencer::callback grob)))
>> +    (if (and (eq? (ly:grob-property grob 'measure-count) 1) (eqv? y-offset 
>> 0.0))
>> +        (ly:staff-symbol-staff-space grob)
>> +        y-offset)))
>> +
>> +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> ;; fret boards
>> 
>> (define-public (fret-board::calc-stencil grob)
>> 
> 
> Compiled cleanly and make check seemed OK, barring an assortment of midi logs 
> and an almost unnoticeable shift in partcombine-midi.ly
> 
> When Mike confirms that this applies to issue 1604, I'll update the issue and 
> set the patch status to "review".
> 
> Colin

I had similar problems with partcombine-midi.ly.  Colin - could you try 
compiling partcombine-midi.ly against this patch manually and see if the same 
problem arises?  When make check does it, I saw a shift, but upon manual 
compilation, the shift disappeared.  Ditto for the files w/ log changes if 
possible.  I'm not sure if it's a build system problem or a problem with the 
current patch.

What's odd is that midi regtests are responding to this change whereas others 
are not, given that this patch is a visual change that (in theory) has nothing 
to do w/ MIDI output.

Cheers,
MS


reply via email to

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