Reviewers: ,
Message:
Hey all,
A colleague of mine is working on a piece where he needs glissandi to
span multiple lines. I made this change and it seems to work. Lemme
know if you think it may break something else. I'll run regtests today
or tomorrow.
To test this patch, do:
\relative c''' { \override Staff . Glissando #'breakable = ##t
<< { s2 a2 \glissando \break s1 \break s1 \break s1 \pageBreak \break s2
c,2 } \\
{ c1 \glissando \break s1 \break s1 \break s1 \pageBreak \break e,1 } >>
}
Cheers,
MS
Description:
Allows line spanners to span multiple lines.
Please review this at http://codereview.appspot.com/4564042/
Affected files:
M lily/line-spanner.cc
Index: lily/line-spanner.cc
diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc
index
0235243628b0dc1a74a9cab08c1d462b14a3bb42..9ef93b099fcd3b58c818f90a74029b3026c1352c
100644
--- a/lily/line-spanner.cc
+++ b/lily/line-spanner.cc
@@ -125,48 +125,16 @@ Line_spanner::calc_bound_info (SCM smob, Direction
dir)
Grob *common_y = me->common_refpoint (me->get_bound (dir), Y_AXIS);
if (me->get_bound (dir)->break_status_dir ())
{
- Spanner *next_sp = me->broken_neighbor (dir);
- Item *next_bound = next_sp->get_bound (dir);
-
- if (next_bound->break_status_dir ())
- {
- programming_error ("no note heads for the line spanner on neighbor
line?"
- " Confused.");
- me->suicide ();
- return SCM_EOL;
- }
-
- Spanner *next_bound_parent = parent_spanner (next_bound);
- Interval next_ext = next_bound->extent (next_bound_parent, Y_AXIS);
-
- /*
- We want to know what would be the y-position of the next
- bound (relative to my y-parent) if it belonged to the
- same system as this bound. We rely on the fact that the
- y-parent of the next bound is a spanner (probably the
- VerticalAxisGroup of a staff) that extends over the break.
- */
- Spanner *next_bound_parent_on_this_line =
- next_bound_parent->broken_neighbor (other_dir (dir));
-
- if (next_bound_parent_on_this_line)
- {
- Grob *common = me->common_refpoint (next_bound_parent_on_this_line,
Y_AXIS);
- Real bound_offset =
next_bound_parent_on_this_line->relative_coordinate (common, Y_AXIS);
- y = next_ext.center () + bound_offset - me->relative_coordinate
(common, Y_AXIS);
- }
- else
- {
- /*
- We fall back to assuming that the distance between
- staves doesn't change over line breaks.
- */
- programming_error ("next-bound's parent doesn't extend to this
line");
- Grob *next_system = next_bound->get_system ();
- Grob *this_system = me->get_system ();
- y = next_ext.center () + next_bound_parent->relative_coordinate
(next_system, Y_AXIS)
- - me->relative_coordinate (this_system, Y_AXIS);
- }
+ Grob *orig = me->original ();
+ if (!orig)
+ {
+ programming_error ("Cannot find a good Y refpoint for a line
spanner.");
+ me->suicide ();
+ return SCM_EOL;
+ }
+ Spanner *orig_s = dynamic_cast<Spanner *> (orig);
+ y = orig_s->get_bound (dir)->extent (common_y, Y_AXIS).center ();
+ details = scm_acons (ly_symbol2scm ("common-Y"), common_y->self_scm (),
details);
}
else
{
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel