From 94860164493ab3a209986b0e3662ff7bd8958cb5 Mon Sep 17 00:00:00 2001 From: Mike Solomon Date: Mon, 28 Mar 2011 10:58:29 -0400 Subject: [PATCH] Assures smooth transitions at glissando line breaks. 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 | 6 ++++++ scm/define-grobs.scm | 1 + 2 files changed, 7 insertions(+) diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 082db2f4b6..5936342d09 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -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 { diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index c3e0c7709c..ab2a87ae3f 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -927,6 +927,7 @@ )) (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) -- 2.39.2