+++ /dev/null
-\version "2.17.2"
-
-\header {
- texidoc = "Dynamics do not horizontally shift when attached to
-an axis-group extremal cross staff grob that's extremal side
-(UP or DOWN) is the same as its direction.
-"
-}
-
-\new PianoStaff <<
- \new Staff = "up" {
- s1 |
- }
- \new Staff = "down" {
- \clef bass
- \stemDown
- % keep staff alive
- <c,, c,>8 [ <c,, c,>8_\f
- \change Staff = "up"
- g' g' ]
- r2 |
- }
->>
return default_outside_staff_padding_;
}
-MAKE_SCHEME_CALLBACK (Axis_group_interface, cross_staff, 1);
-SCM
-Axis_group_interface::cross_staff (SCM smob)
-{
- Grob *me = unsmob_grob (smob);
- extract_grob_set (me, "elements", elts);
- for (vsize i = 0; i < elts.size (); i++)
- if (to_boolean (elts[i]->get_property ("cross-staff")))
- return SCM_BOOL_T;
-
- return SCM_BOOL_F;
-}
-
void
Axis_group_interface::add_element (Grob *me, Grob *e)
{
for (vsize i = 0; i < elts.size (); i++)
{
Grob *se = elts[i];
- if (has_interface (se)
- || !to_boolean (se->get_property ("cross-staff")))
+ if (!to_boolean (se->get_property ("cross-staff")))
{
Interval dims = (bound && has_interface (se)
? generic_bound_extent (se, common, a)
{
Grob *g = elts[i];
- if (to_boolean (g->get_property ("cross-staff"))
- && !has_interface (g))
+ if (to_boolean (g->get_property ("cross-staff")))
continue;
if (!g->is_live ())
{
Grob *elt = elements[i];
Grob *ancestor = outside_staff_ancestor (elt);
- if (!ancestor)
+ if (!(to_boolean (elt->get_property ("cross-staff")) || ancestor))
add_interior_skylines (elt, x_common, y_common, &inside_staff_skylines);
if (ancestor)
riders.insert (pair<Grob *, Grob *> (ancestor, elt));
static Real get_default_outside_staff_padding ();
static Interval generic_bound_extent (Grob *me, Grob *common, Axis a);
static Interval pure_group_height (Grob *me, int start, int end);
- DECLARE_SCHEME_CALLBACK (cross_staff, (SCM smob));
DECLARE_SCHEME_CALLBACK (width, (SCM smob));
DECLARE_SCHEME_CALLBACK (calc_x_common, (SCM smob));
DECLARE_SCHEME_CALLBACK (calc_y_common, (SCM smob));
vector<Box> boxes;
vector<Skyline_pair> skyps;
set<Grob *>::iterator it;
- Real max_raise = -dir * infinity_f;
- bool aligns_to_cross_staff = false;
for (it = support.begin (); it != support.end (); it++)
{
start,
end);
- aligns_to_cross_staff |= cross_staff;
if (Skyline_pair::unsmob (sp))
{
Real xc = pure && dynamic_cast<Spanner *> (e)
copy[dir].set_minimum_height (copy[dir].max_height ());
copy.shift (a == X_AXIS ? yc : xc);
copy.raise (a == X_AXIS ? xc : yc);
- max_raise = minmax (dir, max_raise, a == X_AXIS ? xc : yc);
skyps.push_back (copy);
}
else { /* no warning*/ }
dim.set_minimum_height (0.0);
}
- // Many cross-staff grobs do not have good height estimations.
- // We give the grob the best chance of not colliding by shifting
- // it to the maximum height in the case of cross-staff alignment.
- // This means, in other words, that the old way things were done
- // (using boxes instead of skylines) is just reactivated for
- // alignment to cross-staff grobs.
- if (aligns_to_cross_staff)
- dim.set_minimum_height (dim.max_height ());
-
Real ss = Staff_symbol_referencer::staff_space (me);
Real dist = dim.distance (my_dim, robust_scm2double (me->get_maybe_pure_property ("horizon-padding", pure, start, end), 0.0));
Real total_off = !isinf (dist) ? dir * dist : 0.0;
. (
(axes . (,X ,Y))
(bound-alignment-interfaces . (rhythmic-head-interface stem-interface))
- (cross-staff . ,ly:axis-group-interface::cross-staff)
(horizontal-skylines . ,ly:separation-item::calc-skylines)
(skyline-vertical-padding . 0.15)
(X-extent . ,ly:axis-group-interface::width)