From 6a6a4d4cea2bc7355455b4487a121bfcb529c979 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 28 Aug 2004 16:14:54 +0000 Subject: [PATCH] * input/test/slur-beautiful.ly (Module): remove * input/test/slur-attachment-override.ly (Module): remove * lily/slur-quanting.cc (after_line_breaking): only do scoring when less than 4 control-points. * lily/slur-quanting.cc (get_bezier): new functionality, blow up slur depending on extents of note heads. --- ChangeLog | 7 +++++++ input/test/slur-attachment-override.ly | 29 -------------------------- input/test/slur-beautiful.ly | 22 ------------------- input/test/slur-manual.ly | 4 ++-- lily/slur-quanting.cc | 13 ++++++++---- 5 files changed, 18 insertions(+), 57 deletions(-) delete mode 100644 input/test/slur-attachment-override.ly delete mode 100644 input/test/slur-beautiful.ly diff --git a/ChangeLog b/ChangeLog index cf395f8e94..6ecb6fa610 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-08-28 Han-Wen Nienhuys + * input/test/slur-beautiful.ly (Module): remove + + * input/test/slur-attachment-override.ly (Module): remove + + * lily/slur-quanting.cc (after_line_breaking): only do scoring + when less than 4 control-points. + * lily/key-signature-interface.cc: add style. * Documentation/user/notation.itely (Automatic staff changes): diff --git a/input/test/slur-attachment-override.ly b/input/test/slur-attachment-override.ly deleted file mode 100644 index 7cea32348f..0000000000 --- a/input/test/slur-attachment-override.ly +++ /dev/null @@ -1,29 +0,0 @@ - -\version "2.3.8" - -\header{ -texidoc="@cindex Slur Attachment Override -In some cases, you may want to control the attachment points of a slur -by hand. " -} - - -%% -%% except that both slurs are stem <<-> stem. -%% - -fragment = { - \set autoBeaming = ##f - \override Stem #'direction = #1 - \override Slur #'direction = #1 - d'32( f'4 d8..) - \override Slur #'attachment = #'(stem . stem) - d,32( f'4 d8.) -} - - -\score { - \relative c \fragment - \paper { raggedright = ##t} -} - diff --git a/input/test/slur-beautiful.ly b/input/test/slur-beautiful.ly deleted file mode 100644 index 1aaf89f3bd..0000000000 --- a/input/test/slur-beautiful.ly +++ /dev/null @@ -1,22 +0,0 @@ - -\version "2.3.8" - -\header { texidoc ="@cindex Slur Beautiful -The curvature of a slur is adjusted to stay away from note heads and -stems. When the curvature would increase much, the slur is reverted -to its default shape. The Slur's property @code{beautiful} (which is -loosely related to the enclosed area between the slur and the notes) -controls the transition point, and by increasing that value you may -keep slurs more curved. -" -} - -\score { {\relative c' { - \stemDown \slurUp - c16( a' f' a a f a, c,) - c( a' f' a a f d, c) - \override Slur #'beautiful = #5.0 - c( a' f' a a f d, c) -}} -\paper { raggedright = ##t } -} diff --git a/input/test/slur-manual.ly b/input/test/slur-manual.ly index edfbb8d1d9..5d3ce7cb26 100644 --- a/input/test/slur-manual.ly +++ b/input/test/slur-manual.ly @@ -22,7 +22,7 @@ { \clef bass r4 r8 - \once\override Slur #'extra-offset = #'(0 . -8) + \once\override Slur #'extra-offset = #'(0 . 6) \once\override Slur #'control-points = #'((0 . -4) (2 . 0) (60 . 0) (63 . 4)) c8( as' f c' as @@ -38,6 +38,6 @@ f' c as' f c'4) }>> >> - \paper { raggedright = ##t } + \paper { } } diff --git a/lily/slur-quanting.cc b/lily/slur-quanting.cc index 9f9bde87b7..c25d5c53df 100644 --- a/lily/slur-quanting.cc +++ b/lily/slur-quanting.cc @@ -380,7 +380,8 @@ New_slur::after_line_breaking (SCM smob) if (!get_grob_direction (me)) set_grob_direction (me, get_default_dir (me)); - set_end_points (me); + if (scm_ilength (me->get_property ("control-points")) < 4) + set_end_points (me); return SCM_UNSPECIFIED; } @@ -431,6 +432,9 @@ get_bound_info (Spanner* me, Grob **common) void set_end_points (Grob *me) { + + + Link_array columns = Pointer_group_interface__extract_grobs (me, (Grob *) 0, "note-columns"); @@ -1194,7 +1198,10 @@ get_bezier (Grob *me, continue; Encompass_info inf (get_encompass_info (me, encompasses[i], common)); - avoid.push (Offset (inf.x_, inf.head_ + dir * score_param->free_head_distance_)); + + Real y = dir*((dir * inf.head_) >? (dir *inf.stem_)); + + avoid.push (Offset (inf.x_, y + dir * score_param->free_head_distance_)); } Offset dz = attachments[RIGHT]- attachments[LEFT];; @@ -1239,8 +1246,6 @@ get_bezier (Grob *me, curve.control_[1] = attachments[LEFT] + dz_perp * height * dir + dz_unit * x1; curve.control_[2] = attachments[RIGHT] + dz_perp * height * dir + dz_unit * x2; curve.control_[3] = attachments[RIGHT]; - - return curve; } -- 2.39.5