LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
Grob *accs = proto_support[i];
for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs);
acs = scm_cdr (acs))
for (SCM s = scm_cdar (acs); scm_is_pair (s); s = scm_cdr (s))
{
{
Grob *accs = proto_support[i];
for (SCM acs = accs->get_object ("accidental-grobs"); scm_is_pair (acs);
acs = scm_cdr (acs))
for (SCM s = scm_cdar (acs); scm_is_pair (s); s = scm_cdr (s))
{
// We will only ever want widths of spanners after line breaking
// so we can set pure to false
if (dynamic_cast<Spanner *> (me) && a == X_AXIS)
// We will only ever want widths of spanners after line breaking
// so we can set pure to false
if (dynamic_cast<Spanner *> (me) && a == X_AXIS)
extract_grob_set (me, "side-support-elements", elts);
Direction my_dir = get_grob_direction (me) ;
extract_grob_set (me, "side-support-elements", elts);
Direction my_dir = get_grob_direction (me) ;
{
// for spanner pure heights, we don't know horizontal spacing,
// so a spanner can never have a meaningful x coordiante
{
// for spanner pure heights, we don't know horizontal spacing,
// so a spanner can never have a meaningful x coordiante
Real yc = a == X_AXIS
? me->pure_relative_y_coordinate (common[Y_AXIS], start, end)
: me->get_parent (Y_AXIS)->maybe_pure_coordinate (common[Y_AXIS], Y_AXIS, pure, start, end);
Real yc = a == X_AXIS
? me->pure_relative_y_coordinate (common[Y_AXIS], start, end)
: me->get_parent (Y_AXIS)->maybe_pure_coordinate (common[Y_AXIS], Y_AXIS, pure, start, end);
{
// If called as 'pure' we may not force a stem to set its direction,
if (pure && !is_direction (e->get_property_data ("direction")))
{
// If called as 'pure' we may not force a stem to set its direction,
if (pure && !is_direction (e->get_property_data ("direction")))
{
Real xc = pure && dynamic_cast<Spanner *> (e)
? e->get_parent (X_AXIS)->relative_coordinate (common[X_AXIS], X_AXIS)
{
Real xc = pure && dynamic_cast<Spanner *> (e)
? e->get_parent (X_AXIS)->relative_coordinate (common[X_AXIS], X_AXIS)
Real yc = a == X_AXIS
? e->pure_relative_y_coordinate (common[Y_AXIS], start, end)
: e->maybe_pure_coordinate (common[Y_AXIS], Y_AXIS, pure, start, end);
Real yc = a == X_AXIS
? e->pure_relative_y_coordinate (common[Y_AXIS], start, end)
: e->maybe_pure_coordinate (common[Y_AXIS], Y_AXIS, pure, start, end);
&& to_boolean (me->get_maybe_pure_property ("add-stem-support", pure, start, end)))
copy[dir].set_minimum_height (copy[dir].max_height ());
copy.shift (a == X_AXIS ? yc : xc);
&& to_boolean (me->get_maybe_pure_property ("add-stem-support", pure, start, end)))
copy[dir].set_minimum_height (copy[dir].max_height ());
copy.shift (a == X_AXIS ? yc : xc);
- Maintain a minimum distance to the staff. This is similar to side
- position with padding, but it will put adjoining objects on a row if
+ Ensure 'staff-padding' from my refpoint to the staff. This is similar to
+ side-position with padding, but it will put adjoining objects on a row if
stuff sticks out of the staff a little.
*/
Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
stuff sticks out of the staff a little.
*/
Grob *staff = Staff_symbol_referencer::get_staff_symbol (me);
- /* In case of a ledger lines, quantize even if we're outside the staff. */
- || (Note_head::has_interface (head)
-
- && abs (Staff_symbol_referencer::get_position (head)) > abs (position)))
+ /* If we are between notehead and staff, quantize for ledger lines. */
+ || (has_interface<Note_head> (head)
+ && dir * position < 0))
{
total_off += (rounded - position) * 0.5 * ss;
if (Staff_symbol_referencer::on_line (me, int (rounded)))
{
total_off += (rounded - position) * 0.5 * ss;
if (Staff_symbol_referencer::on_line (me, int (rounded)))
}
else if (scm_is_number (me->get_maybe_pure_property ("staff-padding", pure, start, end)) && dir)
{
}
else if (scm_is_number (me->get_maybe_pure_property ("staff-padding", pure, start, end)) && dir)
{
Real staff_padding
= Staff_symbol_referencer::staff_space (me)
* scm_to_double (me->get_maybe_pure_property ("staff-padding", pure, start, end));
Real staff_padding
= Staff_symbol_referencer::staff_space (me)
* scm_to_double (me->get_maybe_pure_property ("staff-padding", pure, start, end));
Real staff_position = staff->maybe_pure_coordinate (common, Y_AXIS, pure, start, end);
Interval staff_extent = staff->maybe_pure_extent (staff, a, pure, start, end);
Real diff = (dir * staff_extent[dir] + staff_padding
Real staff_position = staff->maybe_pure_coordinate (common, Y_AXIS, pure, start, end);
Interval staff_extent = staff->maybe_pure_extent (staff, a, pure, start, end);
Real diff = (dir * staff_extent[dir] + staff_padding
+ dir * (staff_position - parent_position));
total_off += dir * max (diff, 0.0);
}
+ dir * (staff_position - parent_position));
total_off += dir * max (diff, 0.0);
}
Axis_group_interface::add_element (top_staff, me);
// Remove any cross-staff side-support dependencies
Axis_group_interface::add_element (top_staff, me);
// Remove any cross-staff side-support dependencies