]> git.donarmstrong.com Git - lilypond.git/commitdiff
side-position-interface: cross-staff items, issue 3363
authorKeith OHara <k-ohara5a5a@oco.net>
Fri, 16 Aug 2013 04:10:25 +0000 (21:10 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Sun, 25 Aug 2013 03:31:56 +0000 (20:31 -0700)
Grobs that are not cross-staff are placed before staff-spacing,
so they may not force placement of cross-staff grobs.
When cross-staff items are placed around the spaced staves, let
them side-position using the final, not 'pure', information.

input/regression/slur-cross-staff-beam.ly
lily/side-position-interface.cc
scm/define-grob-properties.scm

index 12c9c1f7a92683ec2e2df2270a361ff14bac9ff0..eca5fe88b931fe1b0c6279fd9ffa7344bbcaf24a 100644 (file)
@@ -1,13 +1,15 @@
-\version "2.16.0"
+\version "2.17.25"
 
 \header {
-  texidoc = "Slurs that depend on a cross-staff beam are not calculated until after line-breaking."
+  texidoc = "Slurs that depend on a cross-staff beam are not calculated until
+after line-breaking, and after inside-going articulations have been placed."
 }
 
 \paper { ragged-right=##t }
 \score {
     \new PianoStaff <<
-    \context Staff = rh \relative c'' { c8([ d) \change Staff = lh c,] }
-    \context Staff = lh { s4. }
+    \context Staff = rh \relative c'' { c8([ d) \change Staff = lh c,] r
+    \stemDown c'8 \change Staff = rh c_( \change Staff = lh c_\marcato c)}
+    \context Staff = lh { s1 }
     >>
 }
index 8e23c2a03bb27734bfcd0b86afd9f42b43ca0025..07076d32c3ff452625e844629d31af387fca98f1 100644 (file)
@@ -203,6 +203,7 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
 
   Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (me);
   bool quantize_position = to_boolean (me->get_maybe_pure_property ("quantize-position", pure, start, end));
+  bool me_cross_staff = to_boolean (me->get_property ("cross-staff"));
 
   bool include_staff
     = staff_symbol
@@ -255,34 +256,29 @@ Side_position_interface::aligned_side (Grob *me, Axis a, bool pure, int start, i
     {
       Grob *e = *it;
 
-      // In the case of a stem, we will find a note head as well
-      // ignoring the stem solves cyclic dependencies if the stem is
-      // attached to a cross-staff beam.
       bool cross_staff = to_boolean (e->get_property ("cross-staff"));
-
-      // avoid cyclic dependency for direction
       if (a == Y_AXIS
-          && pure
-          && Stem::has_interface (e)
-          && cross_staff
-          && !is_direction (e->get_property_data ("direction")))
-        continue;
-
-      // avoid unnecessary stem look up (if pointing away, it is not
-      // supporting anything)
+          && !me_cross_staff // 'me' promised not to adapt to staff-spacing
+          && cross_staff) // but 'e' might move based on staff-pacing
+        continue; // so 'me' may not move in response to 'e'
+
       if (a == Y_AXIS
-          && Stem::has_interface (e)
-          && dir == - get_grob_direction (e))
-        continue;
+          && Stem::has_interface (e))
+        {
+          // If called as 'pure' we may not force a stem to set its direction,
+          if (pure && !is_direction (e->get_property_data ("direction")))
+            continue;
+          // There is no need to consider stems pointing away.
+          if (dir == -get_grob_direction (e))
+            continue;
+        }
 
       if (e)
         {
-
-
            SCM sp = e->get_maybe_pure_property (a == X_AXIS
                                                 ? "horizontal-skylines"
                                                 : "vertical-skylines",
-                                                pure || cross_staff,
+                                                pure,
                                                 start,
                                                 end);
 
index f42f0e8edbe3dfc7e9742c0563e6b4b58b128275..b779edbb4f13b61a3670654a3ab127ffb018ce76 100644 (file)
@@ -1205,8 +1205,15 @@ chord changes.")
 
      (cause ,scheme? "Any kind of causation objects (i.e., music, or perhaps
 translator) that was the cause for this grob.")
-     (cross-staff ,boolean? "For a beam or a stem, this is true if we
-depend on inter-staff spacing.")
+     (cross-staff ,boolean? "True for grobs whose @code{Y-extent} depends on
+inter-staff spacing.  The extent is measured relative to the grobs's parent
+staff (more generally, its @code{VerticalAxisGroup}) so this boolean flags
+grobs that are not rigidly fixed to their parent staff.
+Beams that join notes from two staves are @code{cross-staff}.
+Grobs that are positioned around such beams are also @code{cross-staff}.
+Grobs that are grouping objects, however, like @code{VerticalAxisGroups}
+will not in general be marked @code{cross-staff} when some of the members
+of the group are @code{cross-staff}.")
 
      (delta-position ,number? "The vertical position difference.")