]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 463.
authorNeil Puttock <n.puttock@gmail.com>
Fri, 16 May 2008 23:39:37 +0000 (09:39 +1000)
committerJoe Neeman <joeneeman@gmail.com>
Fri, 16 May 2008 23:39:37 +0000 (09:39 +1000)
Keep better track of the previous staff for a voice.

input/regression/follow-voice-consecutive.ly [new file with mode: 0644]
lily/note-head-line-engraver.cc

diff --git a/input/regression/follow-voice-consecutive.ly b/input/regression/follow-voice-consecutive.ly
new file mode 100644 (file)
index 0000000..97ffc41
--- /dev/null
@@ -0,0 +1,23 @@
+\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 }
+>>
index 152297d9859e25b9b1eefecc1baed79a777e8afb..a499905d623181e9d81573c1e99f701deb3165da 100644 (file)
@@ -54,20 +54,19 @@ void
 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