From: Han-Wen Nienhuys Date: Fri, 15 Apr 2011 02:45:51 +0000 (-0300) Subject: Use distance to original point rather than size of allowed region for X-Git-Tag: release/2.13.60-1~5 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=bf707a03756021f69e3f5d1a8246639a6a601099;p=lilypond.git Use distance to original point rather than size of allowed region for tie-breaking. Add regression test. --- diff --git a/input/regression/beam-collision-large-object.ly b/input/regression/beam-collision-large-object.ly new file mode 100644 index 0000000000..a3dd1dcf44 --- /dev/null +++ b/input/regression/beam-collision-large-object.ly @@ -0,0 +1,15 @@ +\header { + texidoc = "Behave sensibly in the presence of large collisions." +} + +\version "2.13.59" +\new Staff { + << + { \voiceOne s2 } + \\ + { \voiceTwo e4 e } + \\ + { \voiceFour + f''8[ e'' a'' g''] } + >> +} diff --git a/lily/beam.cc b/lily/beam.cc index f39bf9f62c..6845b1346b 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -1303,9 +1303,10 @@ Beam::shift_region_to_valid (SCM grob, SCM posns) || !collision_free[UP].is_empty ()) { // We have space above or below collisions (or, no collisions at - // all). + // all). Should we factor in the size of the collision_free + // interval as well? Interval best = - (collision_free[DOWN].length () > collision_free[UP].length ()) ? + (collision_free[DOWN].distance(beam_left_y) < collision_free[UP].distance (beam_left_y)) ? collision_free[DOWN] : collision_free[UP]; beam_left_y = point_in_interval (best, 2.0);