Reviewers: ,
Message:
I'm using this is in a piece I'm working on and figured it may be useful
in LilyPond. Let me know what you think!
Description:
Allows glissandi to be continuous at line breaks
Please review this at http://codereview.appspot.com/4273098/
Affected files:
M lily/line-spanner.cc
M scm/define-grobs.scm
Index: lily/line-spanner.cc
diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc
index
082db2f4b6b85b228b4a8055b9397d3900798ff9..5936342d09a849b1c3308a124be8dfb4d34ec96d
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
{
Index: scm/define-grobs.scm
diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm
index
db65c46cf8333fc8c27213af569e7c183b98d6ec..47991a7a3ec4161d3754ac921cbf71cc9b61cc02
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)
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel