--- /dev/null
+\version "2.11.46"
+
+\header {
+ texidoc= "The voice follower is not confused when set for consecutive
+sets of staff switches."
+}
+
+\new PianoStaff \relative c' <<
+ \new Staff = "one" {
+ c4
+ \showStaffSwitch
+ \change Staff = two
+ a4
+ \hideStaffSwitch
+ \change Staff = one
+ c4
+ \showStaffSwitch
+ \change Staff = two
+ a4
+ \hideStaffSwitch
+ }
+ \new Staff = "two" { \clef bass s1 }
+>>
Note_head_line_engraver::acknowledge_rhythmic_head (Grob_info info)
{
head_ = info.grob ();
- if (to_boolean (get_property ("followVoice")))
+ Context *tr = context ();
+
+ while (tr && !tr->is_alias (ly_symbol2scm ("Staff")))
+ tr = tr->get_parent_context ();
+
+ if (tr
+ && tr->is_alias (ly_symbol2scm ("Staff")) && tr != last_staff_
+ && to_boolean (get_property ("followVoice")))
{
- Context *tr = context ();
- while (tr && !tr->is_alias (ly_symbol2scm ("Staff")))
- tr = tr->get_parent_context ();
-
- if (tr
- && tr->is_alias (ly_symbol2scm ("Staff")) && tr != last_staff_)
- {
- if (last_head_)
- follow_ = true;
- last_staff_ = tr;
- }
+ if (last_head_)
+ follow_ = true;
}
+ last_staff_ = tr;
}
void