From 0d0c5315f0af21d9178de97876d5401146632c96 Mon Sep 17 00:00:00 2001 From: fred Date: Wed, 27 Mar 2002 01:04:28 +0000 Subject: [PATCH] lilypond-1.4.3 --- lily/hyphen-spanner.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index 1a35efaaed..c222091ef4 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -58,8 +58,12 @@ Hyphen_spanner::brew_molecule (SCM smob) { bounds[LEFT] -= gh_scm2double (space); } - Real w = bounds.length (); + /* + we should probably do something more intelligent when bounds is + empty, but at least this doesn't crash. + */ + Real w = bounds.empty_b () ? 0 : bounds.length (); /* for length, use a geometric mean of the available space and some minimum */ @@ -93,9 +97,8 @@ Hyphen_spanner::brew_molecule (SCM smob) } Box b (Interval (-l/2,l/2), Interval (h,h+th)); Molecule mol (Lookup::filledbox (b)); - mol.translate_axis (bounds.center () - -sp->relative_coordinate (common, X_AXIS), - X_AXIS); + Real ct = bounds.empty_b () ? 0 : bounds.center () ; + mol.translate_axis (ct -sp->relative_coordinate (common, X_AXIS), X_AXIS); return mol.smobbed_copy (); } -- 2.39.5