]> git.donarmstrong.com Git - lilypond.git/commitdiff
use robust_relative_extent if we need the center; issue 4449
authorKeith OHara <k-ohara5a5a@oco.net>
Sat, 20 Jun 2015 06:03:33 +0000 (23:03 -0700)
committerKeith OHara <k-ohara5a5a@oco.net>
Sun, 28 Jun 2015 05:50:53 +0000 (22:50 -0700)
lily/beam-quanting.cc
lily/stem.cc
lily/tuplet-bracket.cc

index 54211ed003c48922782e3b1d0da7991114438a7d..856d8be0b6cf6338e46a20acb5d011701906adbf 100644 (file)
@@ -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;
index 1ddd32986791a35041024f8ee7348a83acffed8e..2fad60d10598f139753cfa87e5c11bab0feb8605 100644 (file)
@@ -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);
     }
 
index a1886620be8d59a135d154a372b4a556e95e9742..a1ad69c72acda43ff5f3eefbddb2374174a0d4fc 100644 (file)
@@ -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]));