From: Mike Solomon Date: Fri, 15 Jun 2012 06:27:17 +0000 (+0200) Subject: Gives stencilless unbeamed stems an empty Y-extent. X-Git-Tag: release/2.15.41-1~48 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=30f2bb655e6f240a795af9f52c1476849b378ead;p=lilypond.git Gives stencilless unbeamed stems an empty Y-extent. --- diff --git a/lily/grob.cc b/lily/grob.cc index cc39c979f0..828ae7f07b 100644 --- a/lily/grob.cc +++ b/lily/grob.cc @@ -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; } diff --git a/lily/stem.cc b/lily/stem.cc index 4b5a68510b..e7ee68b220 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -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)),