From: Keith OHara Date: Fri, 16 Aug 2013 07:46:33 +0000 (-0700) Subject: NoteColumn; do not flag as cross-staff; issue 3503 X-Git-Tag: release/2.17.26-1~18^2~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=7891600a5dd421c1f25776ea3b405c64f4f14752;p=lilypond.git NoteColumn; do not flag as cross-staff; issue 3503 --- diff --git a/input/regression/dynamics-avoid-cross-staff-stem-2.ly b/input/regression/dynamics-avoid-cross-staff-stem-2.ly deleted file mode 100644 index e549646f75..0000000000 --- a/input/regression/dynamics-avoid-cross-staff-stem-2.ly +++ /dev/null @@ -1,23 +0,0 @@ -\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 - 8 [ 8_\f - \change Staff = "up" - g' g' ] - r2 | - } ->> diff --git a/lily/axis-group-interface.cc b/lily/axis-group-interface.cc index 7be90d1a89..449048187d 100644 --- a/lily/axis-group-interface.cc +++ b/lily/axis-group-interface.cc @@ -51,19 +51,6 @@ Axis_group_interface::get_default_outside_staff_padding () 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) { @@ -112,8 +99,7 @@ Axis_group_interface::relative_maybe_bound_group_extent (vector const &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) @@ -254,8 +240,7 @@ Axis_group_interface::adjacent_pure_heights (SCM smob) { 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 ()) @@ -898,7 +883,7 @@ Axis_group_interface::skyline_spacing (Grob *me) { 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 (ancestor, elt)); diff --git a/lily/include/axis-group-interface.hh b/lily/include/axis-group-interface.hh index 1ba26af829..b33a555c7c 100644 --- a/lily/include/axis-group-interface.hh +++ b/lily/include/axis-group-interface.hh @@ -34,7 +34,6 @@ class Axis_group_interface 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)); diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 998813a0ec..e3830d3d2f 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -240,8 +240,6 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i vector boxes; vector skyps; set::iterator it; - Real max_raise = -dir * infinity_f; - bool aligns_to_cross_staff = false; for (it = support.begin (); it != support.end (); it++) { @@ -273,7 +271,6 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i start, end); - aligns_to_cross_staff |= cross_staff; if (Skyline_pair::unsmob (sp)) { Real xc = pure && dynamic_cast (e) @@ -291,7 +288,6 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i 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*/ } @@ -334,15 +330,6 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i 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; diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index d59ad58617..0e94716964 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1605,7 +1605,6 @@ . ( (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)