]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/tuplet-bracket.cc
* input/regression/tie-chord.ly (testLong): add a chord in 4ths
[lilypond.git] / lily / tuplet-bracket.cc
index df5b9f30964af62ae2e83a2f719cc5df03cc1e06..3442e2d522ec91ed67ba18cf0220fb0b38afaab3 100644 (file)
@@ -402,8 +402,12 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
 
   Interval staff;
   if (Grob *st = Staff_symbol_referencer::get_staff_symbol (me))
-    staff = st->extent (commony, Y_AXIS);
-
+    {
+      staff = st->extent (commony, Y_AXIS);
+      Real pad = robust_scm2double (me->get_property ("staff-padding"), 0.5);
+      staff.widen (pad);
+    }
+  
   Direction dir = get_grob_direction (me);
 
   /*
@@ -443,14 +447,9 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
   Real x0 = robust_relative_extent (lgr, commonx, X_AXIS)[LEFT];
   Real x1 = robust_relative_extent (rgr, commonx, X_AXIS)[RIGHT];
 
-  /*
-    offset
-  */
-  Real factor = columns.size () > 1 ? 1 / (x1 - x0) : 1.0;
-
   Array<Offset> points;
-  points.push (Offset (x0, staff[dir]));
-  points.push (Offset (x1, staff[dir]));
+  points.push (Offset (x0 - x0, staff[dir]));
+  points.push (Offset (x1 - x0, staff[dir]));
 
   for (int i = 0; i < columns.size (); i++)
     {
@@ -502,13 +501,14 @@ Tuplet_bracket::calc_position_and_height (Grob *me_grob, Real *offset, Real *dy)
       while (flip (&d) != LEFT);
     }
 
+  Real factor = (columns.size () > 1) ? 1 / (x1 - x0) : 1.0;
   for (int i = 0; i < points.size (); i++)
     {
       Real x = points[i][X_AXIS];
-      Real tuplety = *dy * x * factor;
+      Real tuplety = (*dy) * x * factor;
 
       if (points[i][Y_AXIS] * dir > (*offset + tuplety) * dir)
-       *offset = points[i][Y_AXIS] - tuplety * sign (*dy) * dir;
+       *offset = points[i][Y_AXIS] - tuplety;
     }
 
   *offset += scm_to_double (me->get_property ("padding")) * dir;
@@ -657,8 +657,20 @@ ADD_INTERFACE (Tuplet_bracket,
               "At a line break, the markups in the @code{edge-text} are printed "
               "at the edges. ",
 
-              "note-columns bracket-flare edge-height shorten-pair "
-              "tuplets edge-text break-overshoot "
-              "padding left-position right-position bracket-visibility "
-              "number-visibility thickness direction");
+              
+              "bracket-flare "
+              "bracket-visibility "
+              "break-overshoot "
+              "direction "
+              "edge-height "
+              "edge-text "
+              "left-position "
+              "note-columns "
+              "number-visibility "
+              "padding "
+              "right-position "
+              "shorten-pair "
+              "staff-padding "
+              "thickness "
+              "tuplets ");