Am 22.06.2012 10:49, schrieb David Kastrup:
Marc Hohl <[email protected]> writes:
You are only overriding line-positions. While the bar line printer will
see that this now contains a value and heeds it, this does not magically
affect the (now ignored) line-count property.
Ah, I see, thanks for the explanation.
But why are the dots placed as if there were only four lines?
If the line number is still 5 and the routine in lily/bar-line.cc
works as expected, why are the dots placed correctly?
Huh? Because there is a lot of code for doing that?
{
std::vector<Real> linepos = Staff_symbol::line_positions (staff);
if (!linepos.empty ())
{
centre = Staff_symbol::line_span (staff).center ();
/*
fold the staff into two at centre and find the first gap
big enough to hold a dot and some space below and above
*/
[lots and lots]
And you'll see that Staff_symbol::line_positions consults both in order:
vector<Real>
Staff_symbol::line_positions (Grob *me)
{
SCM line_positions = me->get_property ("line-positions");
if (scm_is_pair (line_positions))
{
int line_count = scm_ilength (line_positions);
vector<Real> values (line_count);
int i = 0;
for (SCM s = line_positions; scm_is_pair (s);
s = scm_cdr (s))
{
values[i++] = scm_to_double (scm_car (s));
}
return values;
}
else
{
int line_count = Staff_symbol::line_count (me);
Real height = line_count - 1;
vector<Real> values (line_count);
for (int i = 0; i < line_count; i++)
{
values[i] = height - i * 2;
}
return values;
}
}
Ok, but in lily/bar-line.cc, Bar_line::compound_barline, the number
of lines is computed by
int lines = Staff_symbol_referencer::line_count (me)
which is defined as
int
Staff_symbol_referencer::line_count (Grob *me)
{
Grob *st = get_staff_symbol (me);
return st ? Staff_symbol::line_count (st) : 0;
}
so the line positions are *not* taken into account, as far as I see.
The computation of the colon stencil follows on the next 8 lines or so,
with the two dots being moved accordingly.
Obviously, I am missing something?
Regards
Marc
_______________________________________________
lilypond-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-devel