]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem.cc
* mf/feta-params.mf (stafflines): introduce linethickness as
[lilypond.git] / lily / stem.cc
index a6203acec92cfc98f507cdc39e1ad06dc23bb464..c4c7ea364f1415bf1b1ad855601b2386dd23fd34 100644 (file)
@@ -462,13 +462,17 @@ Stem::position_noteheads (Grob*me)
     }
   
   bool parity= true;
-  int lastpos = int (Staff_symbol_referencer::get_position (heads[0]));
+  Real lastpos = Real (Staff_symbol_referencer::get_position (heads[0]));
   for (int i=1; i < heads.size (); i ++)
     {
       Real p = Staff_symbol_referencer::get_position (heads[i]);
-      int dy =abs (lastpos- (int)p);
+      Real dy =fabs (lastpos- p);
 
-      if (dy <= 1)
+      /*
+       dy should always be 0.5, 0.0, 1.0, but provide safety margin
+       for rounding errors.
+      */
+      if (dy < 1.1)            
        {
          if (parity)
            {