]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tuplet-bracket.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / tuplet-bracket.cc
index a5f8b6c2424610c46f7464ad76ca611a0bc3660e..d13cf1c613e50d7103533c0f9c779334e73008cb 100644 (file)
@@ -422,12 +422,12 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties.
     straight_corners[d] += -d * shorten[d] / length * dz;
   while (flip (&d) != LEFT);
 
-  if (gap.is_empty ())
-    gap = Interval (0, 0);
-  do
-    gap_corners[d] = (dz * 0.5) + gap[d] / length * dz;
-  while (flip (&d) != LEFT)
-    ;
+  if (!gap.is_empty ())
+    {
+      do
+       gap_corners[d] = (dz * 0.5) + gap[d] / length * dz;
+      while (flip (&d) != LEFT);
+    }
 
   Drul_array<Offset> flare_corners = straight_corners;
   do
@@ -441,14 +441,20 @@ Tuplet_bracket::make_bracket (Grob *me, // for line properties.
   Stencil m;
   do
     {
-      m.add_stencil (Line_interface::line (me, straight_corners[d],
-                                          gap_corners[d]));
+      if (!gap.is_empty ())
+       m.add_stencil (Line_interface::line (me, straight_corners[d],
+                                            gap_corners[d]));
 
       m.add_stencil (Line_interface::line (me, straight_corners[d],
                                           flare_corners[d]));
     }
+
   while (flip (&d) != LEFT);
 
+  if (gap.is_empty ())
+    m.add_stencil (Line_interface::line (me, straight_corners[LEFT],
+                                        straight_corners[RIGHT]));
+  
   return m;
 }
 
@@ -567,8 +573,12 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
       Interval tuplet_x (tuplets[i]->extent (commonx, X_AXIS));
       Interval tuplet_y (tuplets[i]->extent (commony, Y_AXIS));
 
+      if (!tuplets[i]->is_live ())
+       continue;
+      
       Direction d = LEFT;
-      Drul_array<Real> positions = ly_scm2realdrul (tuplets[i]->get_property ("positions"));
+      Drul_array<Real> positions = robust_scm2interval (tuplets[i]->get_property ("positions"),
+                                                       Interval (0,0));
 
       
       Real other_dy = positions[RIGHT] - positions[LEFT];
@@ -727,7 +737,6 @@ Tuplet_bracket::add_tuplet_bracket (Grob *me, Grob *bracket)
 }
 
 ADD_INTERFACE (Tuplet_bracket,
-              "tuplet-bracket-interface",
               "A bracket with a number in the middle, used for tuplets. "
               "When the bracket spans  a line break, the value of "
               "@code{break-overshoot} determines how far it extends "