[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Fixes bug for glissando spanning, adds regtest. (issue4303059)
From: |
mtsolo |
Subject: |
Fixes bug for glissando spanning, adds regtest. (issue4303059) |
Date: |
Mon, 28 Mar 2011 21:42:36 +0000 |
Reviewers: ,
Message:
Sorry again for the premature push - this adds a regtest and clears up
the bug Neil pointed out.
Description:
Fixes bug for glissando spanning, adds regtest.
Please review this at http://codereview.appspot.com/4303059/
Affected files:
A input/regression/glissando-broken-unkilled.ly
M lily/line-spanner.cc
Index: input/regression/glissando-broken-unkilled.ly
diff --git a/input/regression/glissando-broken-unkilled.ly
b/input/regression/glissando-broken-unkilled.ly
new file mode 100644
index
0000000000000000000000000000000000000000..9a7fe6ec24f5f749ce96531994e8822681e6af97
--- /dev/null
+++ b/input/regression/glissando-broken-unkilled.ly
@@ -0,0 +1,36 @@
+\version "2.13.55"
+
+\header {
+ texidoc = "Broken glissandi anticipate the pitch on the next line."
+}
+
+\score {
+ \relative c' {
+ \override Glissando #'after-line-breaking = ##t
+ \override Glissando #'breakable = ##t
+ c1\glissando
+ \break
+ c'1
+ \break
+ c,1\glissando
+ \break
+ s2 c'2
+ }
+ \layout {
+ ragged-right = ##t
+ }
+}
+
+\score {
+ \relative c' {
+ \override Glissando #'after-line-breaking = ##t
+ \override Glissando #'breakable = ##t
+ c1\glissando
+ \break
+ c'1
+ \break
+ c,1\glissando
+ \break
+ s2 c'2
+ }
+}
Index: lily/line-spanner.cc
diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc
index
5936342d09a849b1c3308a124be8dfb4d34ec96d..0235243628b0dc1a74a9cab08c1d462b14a3bb42
100644
--- a/lily/line-spanner.cc
+++ b/lily/line-spanner.cc
@@ -267,7 +267,7 @@ Line_spanner::print (SCM smob)
common_y[d] = unsmob_grob (ly_assoc_get (ly_symbol2scm ("common-Y"),
bounds[d], SCM_BOOL_F));
if (!common_y[d])
- common_y[d] = me;
+ common_y[d] = me;
}
while (flip (&d) != LEFT);
@@ -276,6 +276,12 @@ Line_spanner::print (SCM smob)
span_points[d][Y_AXIS] += common_y[d]->relative_coordinate
(my_common_y, Y_AXIS);
while (flip (&d) != LEFT);
+ 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;
+
Offset dz = (span_points[RIGHT] - span_points[LEFT]);
Offset dz_dir = dz.direction ();
if (gaps[LEFT] + gaps[RIGHT] > dz.length ())
@@ -283,12 +289,6 @@ 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
{
@@ -306,7 +306,7 @@ Line_spanner::print (SCM smob)
SCM off = ly_assoc_get (ly_symbol2scm ("stencil-offset"),
bounds[d], SCM_BOOL_F);
- if (scm_is_number (align))
+ if (scm_is_number (align))
s.align_to (Y_AXIS, scm_to_double (align));
if (is_number_pair (off))
@@ -332,7 +332,7 @@ Line_spanner::print (SCM smob)
if (line_right[X_AXIS] > line_left[X_AXIS])
{
line.add_stencil (Line_interface::line (me, line_left, line_right));
-
+
line.add_stencil (Line_interface::arrows (me,
span_points[LEFT],
span_points[RIGHT],
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Fixes bug for glissando spanning, adds regtest. (issue4303059),
mtsolo <=