From: Han-Wen Nienhuys Date: Fri, 8 Apr 2011 14:19:06 +0000 (-0300) Subject: Divide collision Y extent by staff_space; add regression test. X-Git-Tag: release/2.13.59-1~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a4668131900363364bb2454700c40183cedf4c9b;p=lilypond.git Divide collision Y extent by staff_space; add regression test. This makes collisions work correctly in scaled staves. --- diff --git a/input/regression/beam-collision-scaled-staff.ly b/input/regression/beam-collision-scaled-staff.ly new file mode 100644 index 0000000000..16262ed4bf --- /dev/null +++ b/input/regression/beam-collision-scaled-staff.ly @@ -0,0 +1,14 @@ +\version "2.13.57" +\header { + texidoc = "Beam collisions are resistant to scaled down staves." +} + +\new Staff \with { + fontSize = #-3 + \override StaffSymbol #'staff-space = #(magstep -3) + \override StaffSymbol #'thickness = #(magstep -3) } +<< + \relative c'' { e16[ f] } + \\ + \relative c''' { \autoBeamOff g b } +>> diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index e1116308ed..c5cafd5cfa 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -176,6 +176,8 @@ void Beam_scoring_problem::add_collision (Real x, Interval y, c.beam_y_.widen (0.5 * beam_thickness); c.x_ = x; + + y *= 1/staff_space; c.y_ = y; c.base_penalty_ = score_factor; collisions_.push_back (c);