From: Han-Wen Nienhuys Date: Sat, 4 May 2002 12:55:08 +0000 (+0000) Subject: tremolo fixes X-Git-Tag: release/1.5.55~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c736e466f2674fc9fb160e0fee813999e2540fcd;p=lilypond.git tremolo fixes --- diff --git a/ChangeLog b/ChangeLog index 41ff8d68ea..0804ff0007 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,10 @@ -2002-05-03 Mats Bengtsson +2002-05-04 Han-Wen - * lily/chord-tremolo-engraver.cc (try_music): Handle chord - tremolos of dotted duration. + * lily/stem.cc (off_callback): invisible stem over whole note is + centered on note now. -2002-05-04 Han-Wen + * lily/stem-engraver.cc (acknowledge_grob): X_AXIS Parent of + stem-tremolo is stem now. * input/mozart-hrn*.ly: many corrections. @@ -18,6 +19,11 @@ (check_concave): skip Stolba concaveness check if we have a knee on outer stems. +2002-05-03 Mats Bengtsson + + * lily/chord-tremolo-engraver.cc (try_music): Handle chord + tremolos of dotted duration. + 2002-05-03 Han-Wen * mf/feta-klef.mf: more twiddling with G clef. Almost straight diff --git a/input/regression/stem-tremolo.ly b/input/regression/stem-tremolo.ly index c4ca3f706c..d23f46bd90 100644 --- a/input/regression/stem-tremolo.ly +++ b/input/regression/stem-tremolo.ly @@ -11,7 +11,7 @@ tremolo must be centered on the note. \score{ \context Voice\notes \relative c''{ - \property Voice.Text \set #'direction = #1 + \property Voice.TextScript \set #'direction = #1 \property Voice.TextScript \set #'padding = #5 a1:4^":4" a:8^":8" c:16^":16" a:32^":32" a^"x" a:^":" a4:4 c:8 a:16 c:32 a a: a2: diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index 98d9823249..f58edbfaaa 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -102,6 +102,7 @@ Stem_engraver::acknowledge_grob (Grob_info i) tremolo_flags = 0; tremolo_p_->set_grob_property ("flag-count", gh_int2scm (tremolo_flags)); + tremolo_p_->set_parent (stem_p_, X_AXIS); } } diff --git a/lily/stem-tremolo.cc b/lily/stem-tremolo.cc index 0c3313d3dc..4e10df1676 100644 --- a/lily/stem-tremolo.cc +++ b/lily/stem-tremolo.cc @@ -111,8 +111,7 @@ Stem_tremolo::brew_molecule (SCM smob) // ugh, rather calc from Stem_tremolo_req int beams_i = Stem::beam_count (stem, RIGHT) >? Stem::beam_count (stem, LEFT); - mol.translate (Offset (stem->relative_coordinate (0, X_AXIS) - - me->relative_coordinate (0, X_AXIS), + mol.translate (Offset (0, Stem::stem_end_position (stem) * ss / 2 - Directional_element_interface::get (beam) * beams_i * interbeam)); @@ -125,22 +124,7 @@ Stem_tremolo::brew_molecule (SCM smob) Real dy = Stem::stem_end_position (stem) * ss / 2; dy -= mol.extent (Y_AXIS).length () / 2 * Stem::get_direction (stem); - /* - uhg. Should use relative coords and placement - */ - Real whole_note_correction; - if (Stem::invisible_b (stem)) - { - Grob *hed = Stem::support_head (stem); - whole_note_correction = -Stem::get_direction (stem) - *hed->extent (hed, X_AXIS).length () / 2; - } - else - whole_note_correction = 0; - - mol.translate (Offset (stem->relative_coordinate (0, X_AXIS) - - me->relative_coordinate (0, X_AXIS) + - whole_note_correction, dy)); + mol.translate (Offset (0, dy)); } return mol.smobbed_copy (); diff --git a/lily/stem.cc b/lily/stem.cc index cd20c2397e..600092f8b4 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -664,7 +664,7 @@ Stem::off_callback (SCM element_smob, SCM) Real r=0; - if (invisible_b (me)) + if (head_count (me) == 0) { return gh_double2scm (0.0); } @@ -673,8 +673,15 @@ Stem::off_callback (SCM element_smob, SCM) { Interval head_wid = Note_head::head_extent(f, X_AXIS); - Real attach = - Note_head::stem_attachment_coordinate(f, X_AXIS); + + Real attach =0.0; + + if (invisible_b (me)) + { + attach = 0.0; + } + else + attach = Note_head::stem_attachment_coordinate(f, X_AXIS); Direction d = get_direction (me);