From: Joe Neeman Date: Sat, 10 Feb 2007 16:34:39 +0000 (+0200) Subject: Fix (sort of) the ending position of a line-spanner over a line break. X-Git-Tag: release/2.11.19-1~7^2~9^2~2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b2ff46ad720a8a99939dc04452f2610f165f03c5;p=lilypond.git Fix (sort of) the ending position of a line-spanner over a line break. --- diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index d764a3b717..4e75d0382a 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -92,7 +92,8 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir) Real extra_dy = robust_scm2double (me->get_property ("extra-dy"), 0.0); - + + 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); @@ -109,13 +110,21 @@ Line_spanner::calc_bound_info (SCM smob, Direction dir) Grob *next_common_y = next_sp->common_refpoint (next_bound, X_AXIS); Interval next_ext = next_bound->extent (next_common_y, Y_AXIS); - y = next_ext.center (); + /* FIXME: this is not a real solution. We want to know would be the + y-position of the right bound (relative to the line-spanner) + if it belonged to the same system + as the left bound. What we do instead is to calculate the + y-position of the right bound relative to the VerticalAlignment + (of the next System!) and subtract the y-position of the + line-spanner relative to the VerticalAlignment (of this System!). + This works as long as the distance between staves is approximately + the same before and after breaking. */ + y = next_ext.center () - me->relative_coordinate (common_y, Y_AXIS); } else { - Grob *commony = me->common_refpoint (me->get_bound (dir), Y_AXIS); - y = me->get_bound (dir)->extent (commony, Y_AXIS).center (); - details = scm_acons (ly_symbol2scm ("common-Y"), commony->self_scm (), details); + y = me->get_bound (dir)->extent (common_y, Y_AXIS).center (); + details = scm_acons (ly_symbol2scm ("common-Y"), common_y->self_scm (), details); } y += dir * extra_dy / 2;