]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tuplet-bracket.cc
Issue 5053/2: Fix extendersOverRests property
[lilypond.git] / lily / tuplet-bracket.cc
index a1886620be8d59a135d154a372b4a556e95e9742..340b017723753e5431ecce6379129f65ad212caf 100644 (file)
@@ -64,7 +64,7 @@ get_x_bound_item (Grob *me_grob, Direction hdir, Direction my_dir)
 {
   Spanner *me = dynamic_cast<Spanner *> (me_grob);
   Item *g = me->get_bound (hdir);
-  if (Note_column::has_interface (g)
+  if (has_interface<Note_column> (g)
       && Note_column::get_stem (g)
       && Note_column::dir (g) == my_dir)
     g = Note_column::get_stem (g);
@@ -540,7 +540,7 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
           if (Grob *beam = Stem::get_beam (stems[side]))
             (void) beam->get_property ("quantized-positions");
           poss[side] = stems[side]->extent (stems[side], Y_AXIS)[get_grob_direction (stems[side])]
-                       + stems[side]->get_parent (Y_AXIS)->relative_coordinate (commony, Y_AXIS);
+                       + stems[side]->parent_relative (commony, Y_AXIS);
         }
 
       *dy = poss[RIGHT] - poss[LEFT];
@@ -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]));