From: Keith OHara <k-ohara5a5a@oco.net>
Date: Sat, 20 Jun 2015 06:03:33 +0000 (-0700)
Subject: use robust_relative_extent if we need the center; issue 4449
X-Git-Tag: release/2.19.22-1~4
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a4bba9bab67d47c5601ac84cffb4cbbc34c2a162;p=lilypond.git

use robust_relative_extent if we need the center; issue 4449
---

diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc
index 54211ed003..856d8be0b6 100644
--- a/lily/beam-quanting.cc
+++ b/lily/beam-quanting.cc
@@ -373,7 +373,7 @@ void Beam_scoring_problem::init_instance_variables (Grob *me, Drul_array<Real> y
       for (set<Grob *>::const_iterator it (colliding_stems.begin ()); it != colliding_stems.end (); it++)
         {
           Grob *s = *it;
-          Real x = (s->extent (common[X_AXIS], X_AXIS) - x_pos[LEFT] + x_span_).center ();
+          Real x = (robust_relative_extent (s, common[X_AXIS], X_AXIS) - x_pos[LEFT] + x_span_).center ();
 
           Direction stem_dir = get_grob_direction (*it);
           Interval y;
diff --git a/lily/stem.cc b/lily/stem.cc
index 1ddd329867..2fad60d105 100644
--- a/lily/stem.cc
+++ b/lily/stem.cc
@@ -914,7 +914,7 @@ Stem::offset_callback (SCM smob)
   if (rests.size ())
     {
       Grob *rest = rests.back ();
-      Real r = rest->extent (rest, X_AXIS).center ();
+      Real r = robust_relative_extent (rest, rest, X_AXIS).center ();
       return scm_from_double (r);
     }
 
diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc
index a1886620be..a1ad69c72a 100644
--- a/lily/tuplet-bracket.cc
+++ b/lily/tuplet-bracket.cc
@@ -634,8 +634,11 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
       // Check for number-on-bracket collisions
       Grob *number = unsmob<Grob> (tuplets[i]->get_object ("tuplet-number"));
       if (number)
-        points.push_back (Offset (number->extent (commonx, X_AXIS).center () - x0,
-                                  number->extent (commony, Y_AXIS)[dir]));
+        {
+          Interval x_ext = robust_relative_extent (number, commonx, X_AXIS);
+          Interval y_ext = robust_relative_extent (number, commony, Y_AXIS);
+          points.push_back (Offset (x_ext.center () - x0, y_ext[dir]));
+        }
     }
 
   if (to_boolean (me->get_property ("avoid-scripts"))
@@ -654,8 +657,10 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
           if (unsmob<Grob> (scripts[i]->get_object ("slur")))
             continue;
 
-          Interval script_x (scripts[i]->extent (commonx, X_AXIS));
-          Interval script_y (scripts[i]->extent (commony, Y_AXIS));
+          Interval script_x
+            = robust_relative_extent (scripts[i], commonx, X_AXIS);
+          Interval script_y
+            = robust_relative_extent (scripts[i], commony, Y_AXIS);
 
           points.push_back (Offset (script_x.center () - x0,
                                     script_y[dir]));