]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fixes cross staff issue with beam collision avoidance.
authorMike Solomon <mike@apollinemike.com>
Tue, 26 Apr 2011 11:09:21 +0000 (07:09 -0400)
committerCarl Sorensen <c_sorensen@byu.edu>
Sat, 7 May 2011 15:02:39 +0000 (09:02 -0600)
Beam collision avoidance is now turned off for "fake" cross staff beams
(those that are registered as cross staff because of auto-beaming but
are in fact not).  Additionally, beams no longer process other
cross-staff beams as covered grobs.

This fix closes issue 1632 on the tracker.

input/regression/beam-collision-cross-staff.ly
lily/beam-collision-engraver.cc
lily/beam.cc

index d546aafa18b3cf9393ec836f9bb1cc76893cad62..450c167ad7f11acb8c2807a42e80357f2ecf98d9 100644 (file)
@@ -2,11 +2,25 @@
   texidoc = "cross staff beams work with collisions."
 }
 
-\version "2.13.55"
+\version "2.13.61"
 
-<< 
+<<
  \new Staff = "PianoRH" s4.
  \new Staff = "PianoLH" {
    d''8 [b''! \change Staff = "PianoRH"  d'' ]
  }
 >>
+
+<<
+  \new Staff = up \relative c' {
+    c8 c c c
+    c c c c
+    b' b b b
+  }
+  \new Staff = down \relative c' {
+    s8 c c \change Staff = up c
+    \change Staff = down c [ c s16 \change Staff = up a'16 s16 a16 ]
+    \stemUp
+    \change Staff = down b8 b b b \change Staff = up
+  }
+>>
index 19e9b82caf2c1d482d1a944a5da588ed89298c0b..cdb4be6270dad054ee13c8a8d55d88e52ef12285 100644 (file)
@@ -76,8 +76,6 @@ Beam_collision_engraver::finalize ()
   for (vsize i = 0; i < beams_.size (); i++)
     {
       Grob *beam_grob = beams_[i].grob ();
-      if (Beam::is_cross_staff (beam_grob))
-        continue;
 
       Context *beam_context = beams_[i].context ();
 
index 627ffac0f0f06b4a934ee98c7bbfb994ed4f3f6d..c6cd26143e124fe2e0ca7eecce967cd1284576ed 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "beam.hh"
 
+#include "align-interface.hh"
 #include "beam-scoring-problem.hh"
 #include "beaming-pattern.hh"
 #include "directional-element-interface.hh"
@@ -1204,7 +1205,15 @@ Beam::shift_region_to_valid (SCM grob, SCM posns)
     {
       if (!covered[i]->is_live())
         continue;
-      
+
+      // TODO - use this logic in is_cross_staff.
+      if (is_cross_staff (me)
+          && Align_interface::has_interface (common_refpoint_of_array (stems, me, Y_AXIS)))
+        continue;
+
+      if (Beam::has_interface (covered[i]) && is_cross_staff (covered[i]))
+        continue;
+
       Box b;
       for (Axis a = X_AXIS; a < NO_AXES; incr (a))
         b[a] = covered[i]->extent (common[a], a);