lilypond-devel
[Top][All Lists]
Advanced

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

Re: Remove special case in staff-spacing (issue4188051)


From: k-ohara5a5a
Subject: Re: Remove special case in staff-spacing (issue4188051)
Date: Fri, 29 Jul 2011 05:31:14 +0000

On 2011/07/29 04:31:00, Janek Warchol wrote:
Could you add some comments for rookies like me (the
more, the better)?

Some explanatory comments.  (English takes a lot more space than C.)


http://codereview.appspot.com/4188051/diff/17001/lily/spacing-spanner.cc
File lily/spacing-spanner.cc (right):

http://codereview.appspot.com/4188051/diff/17001/lily/spacing-spanner.cc#newcode526
lily/spacing-spanner.cc:526: Real full_measure_extra_space =
robust_scm2double (l->get_property ("full-measure-extra-space"), 1.0);

I moved the addition of this space (before a single note-column when it
is alone in a measure) earlier because ...

http://codereview.appspot.com/4188051/diff/17001/lily/spacing-spanner.cc#newcode539
lily/spacing-spanner.cc:539: spring = merge_springs (springs);

..when merge_springs() [in spring.cc] combines the desired spacing from
all voices/staves in the system, it lengthens the relaxed-spring
distance of the combined spring enough to give 0.3 space clearance.

The old code first ensured that accidentals were at least 0.3-space away
from the barline, and then added the full-measure-extra-space on top of
that.

http://codereview.appspot.com/4188051/diff/17001/lily/staff-spacing.cc
File lily/staff-spacing.cc (right):

http://codereview.appspot.com/4188051/diff/17001/lily/staff-spacing.cc#newcode208
lily/staff-spacing.cc:208: ideal = max (ideal, fixed);
At an earlier step, while looking up the space to leave after a bar-line
or clef or similar,  the old code made sure that 'fixed' spacing was
enough to leave a bit of clearance.  The 'fixed' distance was intended
to be what gets left if the line is moderately tight, so 'tight'
distance might be a better name.

The problem was that any adjustment to 'fixed' also applied to 'ideal'.
If an accidental would not fit in the tight-spacing gap between a
notehead and barline (they never do) then the 'ideal' distance to the
nothead was increased to the right by nearly the full width of the
accidental.

There is no reason to lengthen a spring when the line has plenty of
room, merely because the space would have been tight if the line were
compressed.  Better to make the spring stiffer, and change the 'ideal'
distance as little as possible.

http://codereview.appspot.com/4188051/diff/17001/lily/staff-spacing.cc#newcode212
lily/staff-spacing.cc:212: ret.set_inverse_compress_strength (max (0.0,
ideal - fixed));
This addition is for issue 1785.  Before 2007 there was only one kind of
strength so one line was enough.

http://codereview.appspot.com/4188051/diff/17001/scm/define-grobs.scm
File scm/define-grobs.scm (left):

http://codereview.appspot.com/4188051/diff/17001/scm/define-grobs.scm#oldcode2237
scm/define-grobs.scm:2237: (extra-spacing-height . (-1.0 . 1.0))
On 2011/07/29 04:31:00, Janek Warchol wrote:
Why this disappeared?

I'm glad you asked.  I /thought/ that I had added this as a hack to
solve issue 1229, which hack would not be necessary if space-alist works
correctly, but I don't see it in my patch.
Next time I have linux up I'll use git-blame to learn why this was
added, and put it back if the reason still holds.

http://codereview.appspot.com/4188051/



reply via email to

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