]> git.donarmstrong.com Git - lilypond.git/commitdiff
Divide collision Y extent by staff_space; add regression test.
authorHan-Wen Nienhuys <hanwen@lilypond.org>
Fri, 8 Apr 2011 14:19:06 +0000 (11:19 -0300)
committerHan-Wen Nienhuys <hanwen@lilypond.org>
Fri, 8 Apr 2011 14:19:57 +0000 (11:19 -0300)
This makes collisions work correctly in scaled staves.

input/regression/beam-collision-scaled-staff.ly [new file with mode: 0644]
lily/beam-quanting.cc

diff --git a/input/regression/beam-collision-scaled-staff.ly b/input/regression/beam-collision-scaled-staff.ly
new file mode 100644 (file)
index 0000000..16262ed
--- /dev/null
@@ -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 }
+>>
index e1116308ed24f18187db2b7c7e2f522e996cb7f1..c5cafd5cfa9acb63e93723eaa7aa76347b06cc8a 100644 (file)
@@ -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);