]> git.donarmstrong.com Git - lilypond.git/commitdiff
(get_control_points): rewrite. Put short ties in
authorhanwen <hanwen>
Sun, 21 Aug 2005 13:48:12 +0000 (13:48 +0000)
committerhanwen <hanwen>
Sun, 21 Aug 2005 13:48:12 +0000 (13:48 +0000)
staff-spaces, make long ties cross staff lines. Avoid flags and dots.

Documentation/topdocs/NEWS.tely
lily/tie.cc

index b434dec97eca2e2a181e62fc38df3cbd26532bc7..a589cf3abb806a518554e8a8aa2cefdf0e89084c 100644 (file)
@@ -36,6 +36,21 @@ This document is also available in @uref{NEWS.pdf,PDF}.
 
 
 @itemize @bullet
+@item
+Formatting of isolated, single ties has been improved. Now, ties avoid
+staff lines, flags and dots, without compromising their shape.
+
+@lilypond[fragment,raggedright]
+\relative c'' {
+  \stemUp
+  c16 c2...~ c16 ~ c2... |
+  c4~c8 c8~c16 c16~c32 c16.~[ c64]~ c64[ c8..] |
+}
+@end lilypond
+
+This improvement has been sponsored by Bertalan Fodor, Jay Hamilton,
+Kieren MacMillan, Steve Doonan, by Trevor Baca, and Vincent SD.
 
 @item
 With the @code{countPercentRepeats} property,
@@ -79,7 +94,7 @@ Tuplets can be made to reach the next non-tuplet note by setting the
 }
 @end lilypond  
 
-This feature was sponsored by Trevor Ba@v{c}a. 
+This feature was sponsored by Trevor Baca. 
 
 @item
 When @code{strict-note-spacing} is set, notes are spaced without regard
@@ -90,7 +105,7 @@ for clefs, bar lines, and grace notes. For example,
 \new Staff { c8[ c \clef alto c \grace { c16[ c] } c8 c c]  c32[ c32] }
 @end lilypond
 
-This feature was sponsored by Trevor Ba@v{c}a. 
+This feature was sponsored by Trevor Baca. 
 
 @item
 Beams support the @code{break-overshoot} property, for example
@@ -101,7 +116,7 @@ Beams support the @code{break-overshoot} property, for example
 c2.. c8[ \break c]
 @end lilypond
  
-This feature was sponsored by Trevor Ba@v{c}a. 
+This feature was sponsored by Trevor Baca. 
 
 @item
 Proportional notation is supported.  Notes can be spaced proportional
@@ -116,7 +131,7 @@ to their time-difference by assigning a duration to
 >>
 @end lilypond
 
-This feature was sponsored by Trevor Ba@v{c}a.
+This feature was sponsored by Trevor Baca.
 
 @item 
 Symbol sizes (e.g. accidentals) are disregarded for spacing if
@@ -134,7 +149,7 @@ Symbol sizes (e.g. accidentals) are disregarded for spacing if
 >>
 @end lilypond
 
-This feature was sponsored by Trevor Ba@v{c}a.
+This feature was sponsored by Trevor Baca.
  
 @item
 Endings of broken tuplet brackets can be tuned.  For example, you can
@@ -150,7 +165,7 @@ add arrows to the brackets,
 }
 @end lilypond
 
-This feature was sponsored by Trevor Ba@v{c}a.
+This feature was sponsored by Trevor Baca.
 
 
 @item
@@ -165,7 +180,7 @@ Arrow heads were added to the Feta font.
 }
 @end lilypond
 
-These glyphs have been sponsored by Trevor Ba@v{c}a.
+These glyphs have been sponsored by Trevor Baca.
 
 
 @item
@@ -179,7 +194,7 @@ Nested tuplets are automatically positioned,
 }
 @end lilypond
 
-This feature was sponsored by Trevor Ba@v{c}a.
+This feature was sponsored by Trevor Baca.
 
 @item
 Music expressions can be displayed, in LilyPond notation, using the
index 408c0acfe3736a42f10ebdb095724c56c4508e39..dc813bdeff288828af6b293777646e694b6c0bc1 100644 (file)
@@ -137,11 +137,12 @@ Tie::get_control_points (SCM smob)
     }
 
   set_direction (me);
-
+  int tie_position = (int) Tie::get_position (me);
+  
   Direction dir = get_grob_direction (me);
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
-  Real staff_position = Tie::get_position (me);
+  Real staff_position = tie_position;
 
   Grob *common[NO_AXES];
   for (int a = X_AXIS; a < NO_AXES; a++)
@@ -230,7 +231,7 @@ Tie::get_control_points (SCM smob)
     Avoid dot
    */
   Grob *left_dot = unsmob_grob (me->get_bound (LEFT)->get_object ("dot"));
-  if (left_dot && in_space && fits_in_space)
+  if (left_dot && in_space)
     {
       if (staff_position == Staff_symbol_referencer::get_position (left_dot))
        {
@@ -258,7 +259,7 @@ Tie::get_control_points (SCM smob)
     Putting larger in-space ties next to the notes forces
     the edges to be opposite (Y-wise) to the tie direction.
    */
-  if (staff_position == Tie::get_position (me)
+  if (staff_position == tie_position
       && in_space
       && dy > 0.3 * staff_space)
     {
@@ -280,7 +281,7 @@ Tie::get_control_points (SCM smob)
 
   if (!in_between
       && in_space
-      && fabs (staff_position - Tie::get_position (me)) <= 1)
+      && fabs (staff_position - tie_position) <= 1)
     staff_position += 2*dir;
   
   
@@ -308,10 +309,15 @@ Tie::get_control_points (SCM smob)
     }
   else
     {
-      Real rounding_dy = (1.5 * dir  - middle[Y_AXIS]);
+      Real where = 0.5 * dir;
       
+      Real rounding_dy = (where - middle[Y_AXIS]);
       b.translate (Offset (0,
                           0.5 * staff_position * staff_space + rounding_dy));
+
+      if (dir * b.curve_point (0.0)[Y_AXIS] <
+         dir * tie_position * 0.5 * staff_space)
+       b.translate (Offset (0, staff_space * dir)); 
     }
   
   b.translate (Offset (attachments[LEFT]