]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-spanner.cc
2003 -> 2004
[lilypond.git] / lily / text-spanner.cc
index b575850ed4cf7dd2f8dabc3124f6068eee54038f..86387458f95ff6a457b2a58ff1274d795f16ad0b 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2000--2003 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 2000--2004 Jan Nieuwenhuizen <janneke@gnu.org>
 
   Revised over good by Han-Wen. 
 */
@@ -40,10 +40,6 @@ Text_spanner::brew_molecule (SCM smob)
   Spanner *spanner = dynamic_cast<Spanner*> (me);
   
   /* Ugh, must be same as Hairpin::brew_molecule.  */
-  Real padding = 0.0;
-  SCM itp= me->get_grob_property ("if-text-padding");
-  if (gh_number_p (itp))
-    padding = gh_scm2double (itp);
 
   Grob *common = spanner->get_bound (LEFT)->common_refpoint (spanner->get_bound (RIGHT), X_AXIS);
   Paper_def * paper = me->get_paper();
@@ -68,8 +64,8 @@ Text_spanner::brew_molecule (SCM smob)
        }
       else
          {
-           bool encl = to_boolean (me->get_grob_property ("enclose-bounds"));
-           span_points[d] = b->extent (common, X_AXIS)[encl ? d : -d];
+           Real encl = robust_scm2double (me->get_grob_property ("enclose-bounds"), 0.0);
+           span_points[d] = b->extent (common, X_AXIS).linear_combination (d * encl);
 
            if (is_number_pair (shorten))
              span_points -= d * gh_scm2double (index_get_cell (shorten, d));
@@ -105,7 +101,7 @@ Text_spanner::brew_molecule (SCM smob)
     }
   
   Drul_array<Real> edge_height = robust_scm2interval (me->get_grob_property ("edge-height"),
-                                                     Interval (1.0, 1.0));
+                                                     Interval (0.0, 0.0));
   Drul_array<Molecule> edge_line;
     {
       Direction d = LEFT;
@@ -116,7 +112,7 @@ Text_spanner::brew_molecule (SCM smob)
            continue;
          
          Real dx = 0.0;
-         if (gh_pair_p (flare))
+         if (is_number_pair (flare))
            dx = gh_scm2double (index_get_cell (flare, d)) * d;
 
          Real dy = - dir * edge_height[d] ;
@@ -160,5 +156,5 @@ Text_spanner::brew_molecule (SCM smob)
 
 ADD_INTERFACE (Text_spanner,"text-spanner-interface",
               "generic text spanner",
-              "text-repeat-if-broken dash-period if-text-padding dash-fraction edge-height bracket-flare edge-text shorten-pair style thickness enclose-bounds width-correct");
+              "text-repeat-if-broken dash-period if-text-padding dash-fraction edge-height bracket-flare edge-text shorten-pair style thickness enclose-bounds");