]> git.donarmstrong.com Git - lilypond.git/commitdiff
Gives stencilless unbeamed stems an empty Y-extent.
authorMike Solomon <mike@apollinemike.com>
Fri, 15 Jun 2012 06:27:17 +0000 (08:27 +0200)
committerMike Solomon <mike@apollinemike.com>
Fri, 15 Jun 2012 06:27:17 +0000 (08:27 +0200)
lily/grob.cc
lily/stem.cc

index cc39c979f0e9cf146b40975b01f82ed9441d08bc..828ae7f07b40687457f8031475f0a42d9992dc67 100644 (file)
@@ -466,7 +466,10 @@ Grob::extent (Grob *refp, Axis a) const
       ((Grob *)this)->dim_cache_[a].extent_ = new Interval (real_ext);
     }
 
-  real_ext.translate (offset);
+  // We never want nan, so we avoid shifting infinite values.
+  for (LEFT_and_RIGHT (d))
+    if (!isinf (real_ext[d]))
+      real_ext[d] += offset;
 
   return real_ext;
 }
index 4b5a68510b2752cc43fe4a160e40add3d4673c0b..e7ee68b220ea36b7943d3ce503c92db54fbc6d83 100644 (file)
@@ -689,7 +689,7 @@ Interval
 Stem::internal_height (Grob *me, bool calc_beam)
 {
   Grob *beam = get_beam (me);
-  if (!is_valid_stem (me) && ! beam)
+  if (!is_valid_stem (me) && !beam)
     return Interval ();
 
   Direction dir = get_grob_direction (me);
@@ -700,6 +700,13 @@ Stem::internal_height (Grob *me, bool calc_beam)
       (void) beam->get_property ("quantized-positions");
     }
 
+  /*
+    If there is a beam but no stem, slope calculations depend on this
+    routine to return where the stem end /would/ be.
+  */
+  if (!beam && !unsmob_stencil (me->get_property ("stencil")))
+    return Interval ();
+
   Real y1 = robust_scm2double ((calc_beam
                                 ? me->get_property ("stem-begin-position")
                                 : me->get_pure_property ("stem-begin-position", 0, INT_MAX)),