This avoids setting cross-staff to #t at the engraver stage, which
results in the erroneous labelling certain span-arpeggios as cross-staff.
--- /dev/null
+\version "2.17.26"
+
+\header {
+ texidoc = "Span arpeggios that are not cross-staff do not have
+horizontal spacing problems.
+"
+}
+
+
+\new Staff
+\with
+{
+ \consists "Span_arpeggio_engraver"
+}
+\relative c''
+{
+ \set Staff.connectArpeggios = ##t
+ <<
+ {r2. <ges aes c ges'>4\arpeggio |}
+ \\
+ {\repeat unfold 12 aes,16 <ees aes c>4\arpeggio |}
+ >>
+}
+MAKE_SCHEME_CALLBACK (Arpeggio, calc_cross_staff, 1);
+SCM
+Arpeggio::calc_cross_staff (SCM grob)
+{
+ Grob *me = unsmob_grob (grob);
+
+ extract_grob_set (me, "stems", stems);
+ Grob *vag = 0;
+
+ for (vsize i = 0; i < stems.size (); i++)
+ {
+ if (!i)
+ vag = Grob::get_vertical_axis_group (stems[i]);
+ else
+ {
+ if (vag != Grob::get_vertical_axis_group (stems[i]))
+ return SCM_BOOL_T;
+ }
+ }
+
+ return SCM_BOOL_F;
+}
+
MAKE_SCHEME_CALLBACK (Arpeggio, calc_positions, 1);
SCM
Arpeggio::calc_positions (SCM grob)
MAKE_SCHEME_CALLBACK (Arpeggio, calc_positions, 1);
SCM
Arpeggio::calc_positions (SCM grob)
static Grob *get_common_y (Grob *);
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
static Grob *get_common_y (Grob *);
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (calc_positions, (SCM));
+ DECLARE_SCHEME_CALLBACK (calc_cross_staff, (SCM));
DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM));
DECLARE_SCHEME_CALLBACK (brew_chord_slur, (SCM));
DECLARE_SCHEME_CALLBACK (width, (SCM));
DECLARE_SCHEME_CALLBACK (brew_chord_bracket, (SCM));
DECLARE_SCHEME_CALLBACK (brew_chord_slur, (SCM));
DECLARE_SCHEME_CALLBACK (width, (SCM));
*/
if (!span_arpeggio_ && arpeggios_.size () > 1
&& to_boolean (get_property ("connectArpeggios")))
*/
if (!span_arpeggio_ && arpeggios_.size () > 1
&& to_boolean (get_property ("connectArpeggios")))
- {
- span_arpeggio_ = make_item ("Arpeggio", SCM_EOL);
- span_arpeggio_->set_property ("cross-staff", SCM_BOOL_T);
- }
+ span_arpeggio_ = make_item ("Arpeggio", SCM_EOL);
+
if (span_arpeggio_)
{
for (vsize i = 0; i < note_columns_.size (); i++)
if (span_arpeggio_)
{
for (vsize i = 0; i < note_columns_.size (); i++)
+ (cross-staff . ,ly:arpeggio::calc-cross-staff)
(direction . ,LEFT)
(padding . 0.5)
(positions . ,ly:arpeggio::calc-positions)
(direction . ,LEFT)
(padding . 0.5)
(positions . ,ly:arpeggio::calc-positions)