]> git.donarmstrong.com Git - lilypond.git/commitdiff
NoteColumn; do not flag as cross-staff; issue 3503
authorKeith OHara <k-ohara5a5a@oco.net>
Fri, 16 Aug 2013 07:46:33 +0000 (00:46 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Tue, 27 Aug 2013 18:21:43 +0000 (11:21 -0700)
input/regression/dynamics-avoid-cross-staff-stem-2.ly [deleted file]
lily/axis-group-interface.cc
lily/include/axis-group-interface.hh
lily/side-position-interface.cc
scm/define-grobs.scm

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 (file)
index e549646..0000000
+++ /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
-    <c,, c,>8 [ <c,, c,>8_\f
-    \change Staff = "up"
-    g' g' ]
-    r2 |
-  }
->>
index 7be90d1a89a61190d0a1d84c2254679bc2a9b35a..449048187d93f4e3254693c3795ebcb9728a8359 100644 (file)
@@ -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<Grob *> 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<Grob *, Grob *> (ancestor, elt));
index 1ba26af829459cebb6ce4c632a4792a1bf421953..b33a555c7cd81b65bded19d111b770fc6ea8323c 100644 (file)
@@ -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));
index 998813a0ec7199d93d284dbe4236a9ebd6d3664e..e3830d3d2f7d5484f8e3291e58385808aa64f491 100644 (file)
@@ -240,8 +240,6 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
   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++)
     {
@@ -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<Spanner *> (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;
index d59ad586170aabfa222a26d47b0bbe93fbf363b8..0e94716964e1ca7e911d99920347ce6945d34647 100644 (file)
      . (
         (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)