]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/line-spanner.cc
Add ties from Completion_note_heads_engraver to a TieColumn.
[lilypond.git] / lily / line-spanner.cc
index 082db2f4b6b85b228b4a8055b9397d3900798ff9..d7f4837a2511f936877ec8d1d0e09e04b827a5ed 100644 (file)
@@ -246,7 +246,6 @@ Line_spanner::print (SCM smob)
 
   Drul_array<Real> gaps (0, 0);
   Drul_array<bool> arrows (0, 0);
-  Drul_array<Real> anchor_align (0, 0);
   Drul_array<Stencil *> stencils (0,0);
   Drul_array<Grob *> common_y (0, 0);
 
@@ -260,14 +259,12 @@ Line_spanner::print (SCM smob)
                                                 bounds[d], SCM_BOOL_F), 0.0);
       arrows[d] = to_boolean (ly_assoc_get (ly_symbol2scm ("arrow"),
                                            bounds[d], SCM_BOOL_F));
-      anchor_align[d] = robust_scm2double (ly_assoc_get (ly_symbol2scm ("anchor-alignment"),
-                                                        bounds[d], SCM_BOOL_F), LEFT);
       stencils[d] = unsmob_stencil (ly_assoc_get (ly_symbol2scm ("stencil"),
                                                  bounds[d], SCM_BOOL_F));
       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 +273,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 ())
@@ -290,17 +293,13 @@ Line_spanner::print (SCM smob)
 
       if (stencils[d])
        {
-         Interval ext = stencils[d]->extent (X_AXIS);
-         Real anchor = ext.linear_combination (anchor_align[d]) - ext[LEFT];
-         span_points[d][X_AXIS] -= anchor;
-
          Stencil s = stencils[d]->translated (span_points[d]);
          SCM align = ly_assoc_get (ly_symbol2scm ("stencil-align-dir-y"),
                                    bounds[d], SCM_BOOL_F);
          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))
@@ -326,7 +325,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],