]> git.donarmstrong.com Git - lilypond.git/commitdiff
(print): only take linear_combination of
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 2 Aug 2004 16:55:46 +0000 (16:55 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 2 Aug 2004 16:55:46 +0000 (16:55 +0000)
nonempty interval.

ChangeLog
lily/dynamic-text-spanner.cc
lily/text-spanner.cc

index 82c403631f385e70f4923d2f0f360f9b71d2bd04..1b0e71e2b1a33932cdbb4e7ee8cad3c99240e7c2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2004-08-02  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/text-spanner.cc (print): only take linear_combination of
+       nonempty interval.
+       
+
 2004-08-02  Pedro Kroger  <kroeger@pedrokroeger.net>
 
        * scm/page-layout.scm (default-page-make-stencil): If leftmargin
index b47edf2182fc10ddbe1df5f30ee8df5b835fac8f..80a955d98b37a337fe4f418c024402c98e34aa2b 100644 (file)
@@ -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);
index d5f98914f5f79169e753b8bcb3be0124ea34d002..4795e5bb0ad86c33770312943f25c23f8ea68b64 100644 (file)
@@ -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));