From cc28c86747ee1e32d6c42e7737e47efcec74f59a Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Sat, 18 Aug 2007 13:45:48 +1000 Subject: [PATCH] Fix 369. When a slur goes over cross-staff stems, the slur should be marked cross-staff too. --- input/regression/slur-cross-staff-beam.ly | 13 +++++++++++++ lily/slur.cc | 8 ++++++++ 2 files changed, 21 insertions(+) create mode 100644 input/regression/slur-cross-staff-beam.ly diff --git a/input/regression/slur-cross-staff-beam.ly b/input/regression/slur-cross-staff-beam.ly new file mode 100644 index 0000000000..ea9d13df3a --- /dev/null +++ b/input/regression/slur-cross-staff-beam.ly @@ -0,0 +1,13 @@ +\version "2.11.29" + +\header { + texidoc = "Slurs that depend on a cross-staff beam are not calculated until after line-breaking." +} + +\paper{ ragged-right=##t } +\score { + \new PianoStaff << + \context Staff = rh \relative { c'8([ d) \change Staff = lh c,] } + \context Staff = lh { s4. } + >> +} \ No newline at end of file diff --git a/lily/slur.cc b/lily/slur.cc index 22535ef765..c37aa72ad9 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -14,6 +14,7 @@ #include "bezier.hh" #include "directional-element-interface.hh" #include "font-interface.hh" +#include "item.hh" #include "pointer-group-interface.hh" #include "lookup.hh" #include "main.hh" // DEBUG_SLUR_SCORING @@ -368,6 +369,13 @@ Slur::calc_cross_staff (SCM smob) extract_grob_set (me, "note-columns", cols); extract_grob_set (me, "encompass-objects", extras); + for (vsize i = 0; i < cols.size (); i++) + { + if (Grob *s = Note_column::get_stem (cols[i])) + if (to_boolean (s->get_property ("cross-staff"))) + return SCM_BOOL_T; + } + /* the separation items are dealt with in replace_breakable_encompass_objects so we can ignore them here */ vector non_sep_extras; -- 2.39.5