lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: beam.cc:pure-rest-collision-callback Place on staff lines; issue 246


From: k-ohara5a5a
Subject: Re: beam.cc:pure-rest-collision-callback Place on staff lines; issue 2468 (issue 6035053)
Date: Sun, 15 Apr 2012 16:45:54 +0000

Reviewers: Graham Percival, dak,

Message:
On 2012/04/15 15:32:10, dak wrote:

if max/min trigger, rint is applied to some rest_max_pos.  It would >
appear that it should rather apply only to the calculated mean.

I want the final output to be an integral number of staff spaces, and
rest_max_pos might not be.  (Despite its name, rest_max_pos is in units
of staff-spaces, usually 2.5)

every second staff line will get avoided for values in between.

Yes, the tentative placement for beamed rests favors the middle,
uppermost, and lowermost lines, in the usual five-line staff.

An improvement would be to round-to-larger, as in
rest_collision_callback() when it sets the final position of the rest.
That function is also more careful to make the shift relative to
'prev_offset' an integral number of staff spaces, rather than the
position relative to staff-center.

Description:
beam.cc:pure-rest-collision-callback Place on staff lines; issue 2468

Please review this at http://codereview.appspot.com/6035053/

Affected files:
  M lily/beam.cc


Index: lily/beam.cc
diff --git a/lily/beam.cc b/lily/beam.cc
index 0cfc3e193cba6b3feea911abb09a6f9e5118d6c2..0cb9946eec038e9fca0960072a0fa5d49e712a7c 100644
--- a/lily/beam.cc
+++ b/lily/beam.cc
@@ -1372,7 +1372,7 @@ Beam::pure_rest_collision_callback (SCM smob,
     then bound it by the minimum and maximum positions outside the staff.
     4.0 = 2.0 to get out of staff space * 2.0 for the average
   */
- amount = min (max ((Stem::head_positions (left)[beamdir] + Stem::head_positions (right)[beamdir]) / 4.0, rest_max_pos[DOWN]), rest_max_pos[UP]); + amount = rint( min (max ((Stem::head_positions (left)[beamdir] + Stem::head_positions (right)[beamdir]) / 4.0, rest_max_pos[DOWN]), rest_max_pos[UP]));

   return scm_from_double (amount);
 }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]