From: hanwen Date: Sun, 21 Aug 2005 13:48:12 +0000 (+0000) Subject: (get_control_points): rewrite. Put short ties in X-Git-Tag: release/2.6.4~17^2~19 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=3c3987f65ce05a80e29e37552ccab86600cefc4d;p=lilypond.git (get_control_points): rewrite. Put short ties in staff-spaces, make long ties cross staff lines. Avoid flags and dots. --- diff --git a/Documentation/topdocs/NEWS.tely b/Documentation/topdocs/NEWS.tely index b434dec97e..a589cf3abb 100644 --- a/Documentation/topdocs/NEWS.tely +++ b/Documentation/topdocs/NEWS.tely @@ -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 diff --git a/lily/tie.cc b/lily/tie.cc index 408c0acfe3..dc813bdeff 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -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]