From aa0e44d839481af204792329e7dfe1d5c831c1e8 Mon Sep 17 00:00:00 2001 From: hanwen Date: Mon, 2 Aug 2004 16:55:46 +0000 Subject: [PATCH] (print): only take linear_combination of nonempty interval. --- ChangeLog | 6 ++++++ lily/dynamic-text-spanner.cc | 8 ++++++-- lily/text-spanner.cc | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82c403631f..1b0e71e2b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-08-02 Han-Wen Nienhuys + + * lily/text-spanner.cc (print): only take linear_combination of + nonempty interval. + + 2004-08-02 Pedro Kroger * scm/page-layout.scm (default-page-make-stencil): If leftmargin diff --git a/lily/dynamic-text-spanner.cc b/lily/dynamic-text-spanner.cc index b47edf2182..80a955d98b 100644 --- a/lily/dynamic-text-spanner.cc +++ b/lily/dynamic-text-spanner.cc @@ -86,8 +86,12 @@ Dynamic_text_spanner::print (SCM smob) pad = robust_scm2double (me->get_property ("bound-padding"), 0.0); encl = -d; } - - span_points[d] = -d * pad + b->extent (common, X_AXIS).linear_combination (encl); + + Interval ext = b->extent (common, X_AXIS); + span_points[d] = -d * pad + + (ext.is_empty ()) + ? b->relative_coordinate (common, X_AXIS) + : ext.linear_combination (encl); } } while (flip (&d) != LEFT); diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index d5f98914f5..4795e5bb0a 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -65,7 +65,12 @@ Text_spanner::print (SCM smob) else { Real encl = robust_scm2double (me->get_property ("enclose-bounds"), 0.0); - span_points[d] = b->extent (common, X_AXIS).linear_combination (d * encl); + Interval ext = b->extent (common, X_AXIS); + + span_points[d] = + (ext.is_empty()) + ? b->relative_coordinate (common, X_AXIS) + : ext.linear_combination (d * encl); if (is_number_pair (shorten)) span_points -= d * ly_scm2double (index_get_cell (shorten, d)); -- 2.39.5