summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Solomon <mike@apollinemike.com>2011-04-26 07:09:21 -0400
committerMike Solomon <mike@apollinemike.com>2011-04-26 07:09:21 -0400
commitf9116bac398f94d95e237aa3b1fc222a59ad8e3c (patch)
tree15e47f9f09789d61cf0d72c1bb964ea24ccb8714
parent520b0226025a596a849b852843c0841c7d7256a5 (diff)
Fixes cross staff issue with beam collision avoidance.
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.
-rw-r--r--input/regression/beam-collision-cross-staff.ly18
-rw-r--r--lily/beam-collision-engraver.cc2
-rw-r--r--lily/beam.cc11
3 files changed, 26 insertions, 5 deletions
diff --git a/input/regression/beam-collision-cross-staff.ly b/input/regression/beam-collision-cross-staff.ly
index d546aafa18..450c167ad7 100644
--- a/input/regression/beam-collision-cross-staff.ly
+++ b/input/regression/beam-collision-cross-staff.ly
@@ -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
+ }
+>>
diff --git a/lily/beam-collision-engraver.cc b/lily/beam-collision-engraver.cc
index 19e9b82caf..cdb4be6270 100644
--- a/lily/beam-collision-engraver.cc
+++ b/lily/beam-collision-engraver.cc
@@ -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 ();
diff --git a/lily/beam.cc b/lily/beam.cc
index 1ae30fb5f8..938567984e 100644
--- a/lily/beam.cc
+++ b/lily/beam.cc
@@ -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);