]> git.donarmstrong.com Git - lilypond.git/commitdiff
Assures smooth transitions at glissando line breaks.
authorMike Solomon <mike@apollinemike.com>
Mon, 28 Mar 2011 14:58:29 +0000 (10:58 -0400)
committerMike Solomon <mike@apollinemike.com>
Mon, 28 Mar 2011 14:58:29 +0000 (10:58 -0400)
When a glissando breaks over lines, the left point of the beginning-of-line
glissando picks up on the y-axis where the right point of the end-of-line
glissando ends.

lily/line-spanner.cc
scm/define-grobs.scm

index 082db2f4b6b85b228b4a8055b9397d3900798ff9..5936342d09a849b1c3308a124be8dfb4d34ec96d 100644 (file)
@@ -283,6 +283,12 @@ Line_spanner::print (SCM smob)
       return SCM_EOL;
     }
 
+  Interval normalized_endpoints = robust_scm2interval (me->get_property ("normalized-endpoints"), Interval (0, 1));
+  Real y_length = span_points[RIGHT][Y_AXIS] - span_points[LEFT][Y_AXIS];
+
+  span_points[LEFT][Y_AXIS] += normalized_endpoints[LEFT] * y_length;
+  span_points[RIGHT][Y_AXIS] -= (1 - normalized_endpoints[RIGHT]) * y_length;
+
   Stencil line;
   do
     {
index c3e0c7709c73a39a65d858d683a7b2fa600e21b7..ab2a87ae3f862eb26565c2c7efb36a6ca5acf426 100644 (file)
                          ))
        (gap . 0.5)
        (left-bound-info . ,ly:line-spanner::calc-left-bound-info)
+       (normalized-endpoints . ,ly:spanner::calc-normalized-endpoints)
        (right-bound-info . ,ly:line-spanner::calc-right-bound-info)
        (stencil . ,ly:line-spanner::print)
        (style . line)