]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/side-position-interface.cc
release: 1.3.90
[lilypond.git] / lily / side-position-interface.cc
index e82bf70465d60084707dab3d3db906cd9f261a0c..bfb4ff7d844331814ef0709e6b52ef43aa46f20c 100644 (file)
@@ -148,7 +148,10 @@ directed_round (Real f, Direction d)
 
 /*
   Callback that quantises in staff-spaces, rounding in the direction
-  of the elements "direction" elt property. */
+  of the elements "direction" elt property.
+
+  Only rounds when we're inside the staff, as determined by
+  Staff_symbol_referencer::staff_radius() */
 Real
 Side_position::quantised_position (Score_element *me, Axis )
 {
@@ -158,9 +161,10 @@ Side_position::quantised_position (Score_element *me, Axis )
     {
       Real p = Staff_symbol_referencer::position_f (me);
       Real rp = directed_round (p, d);
-
+      Real rad = Staff_symbol_referencer::staff_radius (me) *2 ;
       int ip = int  (rp);
-      if ((ip % 2) == 0)
+
+      if (abs (ip) < rad && (ip % 2) == 0)
        {
          ip += d;
          rp += d;