From 601812a35409ef1e34621df1721dbc6fb6e26c3e Mon Sep 17 00:00:00 2001 From: Keith OHara Date: Thu, 15 Aug 2013 21:10:25 -0700 Subject: [PATCH] side-position-interface: cross-staff items, issue 3363 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 | 10 ++++--- lily/side-position-interface.cc | 34 ++++++++++------------- scm/define-grob-properties.scm | 11 ++++++-- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/input/regression/slur-cross-staff-beam.ly b/input/regression/slur-cross-staff-beam.ly index 12c9c1f7a9..eca5fe88b9 100644 --- a/input/regression/slur-cross-staff-beam.ly +++ b/input/regression/slur-cross-staff-beam.ly @@ -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 } >> } diff --git a/lily/side-position-interface.cc b/lily/side-position-interface.cc index 8e23c2a03b..07076d32c3 100644 --- a/lily/side-position-interface.cc +++ b/lily/side-position-interface.cc @@ -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); diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index f42f0e8edb..b779edbb4f 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -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.") -- 2.39.5