From: Han-Wen Nienhuys Date: Thu, 21 Dec 2006 13:59:10 +0000 (+0100) Subject: coding style nits; more accurate programming_error for introducing infinity. X-Git-Tag: release/2.11.5-1~39^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3089416af2cb8f0c4dac3fe2b58e10744100403f;p=lilypond.git coding style nits; more accurate programming_error for introducing infinity. --- diff --git a/lily/align-interface.cc b/lily/align-interface.cc index e4505675df..319ca2db2e 100644 --- a/lily/align-interface.cc +++ b/lily/align-interface.cc @@ -145,8 +145,10 @@ get_skylines (Grob *me, Interval extent = g->maybe_pure_extent (g, a, pure, start, end); Interval other_extent = pure ? Interval (-infinity_f, infinity_f) : g->extent (other_axis_common, other_axis (a)); - Box b = (a == X_AXIS) ? Box (extent, other_extent) : Box (other_extent, extent); - + Box b; + b[a] = extent; + b[other_axis (a)] = other_extent; + if (extent.is_empty ()) { elements->erase (elements->begin () + i); @@ -234,6 +236,12 @@ Align_interface::get_extents_aligned_translates (Grob *me, else dy = skylines[j-1][stacking_dir].distance (skylines[j][-stacking_dir]); + if (isinf (dy)) + { + programming_error ("infinite skyline distance"); + dy = 0.0; + } + where += stacking_dir * (dy + padding + extra_space / elems.size ()); translates.push_back (where); }