]> git.donarmstrong.com Git - lilypond.git/commitdiff
tremolo fixes
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 4 May 2002 12:55:08 +0000 (12:55 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sat, 4 May 2002 12:55:08 +0000 (12:55 +0000)
ChangeLog
input/regression/stem-tremolo.ly
lily/stem-engraver.cc
lily/stem-tremolo.cc
lily/stem.cc

index 41ff8d68eae4d08a8570c1c8411b793de0e0ae4c..0804ff0007ed83f5e17cca767a18a266dabe9d5e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
-2002-05-03  Mats Bengtsson  <mats.bengtsson@s3.kth.se>
+2002-05-04  Han-Wen  <hanwen@cs.uu.nl>
 
-       * 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  <hanwen@cs.uu.nl>
+       * lily/stem-engraver.cc (acknowledge_grob): X_AXIS Parent of
+       stem-tremolo is stem now.
 
        * input/mozart-hrn*.ly: many corrections. 
 
        (check_concave): skip Stolba concaveness check if we have a knee
        on outer stems.
 
+2002-05-03  Mats Bengtsson  <mats.bengtsson@s3.kth.se>
+
+       * lily/chord-tremolo-engraver.cc (try_music): Handle chord
+       tremolos of dotted duration.
+
 2002-05-03  Han-Wen  <hanwen@cs.uu.nl>
 
        * mf/feta-klef.mf: more twiddling with G clef. Almost straight
index c4ca3f706c4630c900d179d949344baaa6b1913e..d23f46bd90eece4b8c9cf4567e59cda93301166b 100644 (file)
@@ -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:
index 98d9823249b8c44c67ff2e6ff7b3c8009a037e72..f58edbfaaa236a5ae3002d1163fa78ed33af3a5a 100644 (file)
@@ -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);
                }
            }
 
index 0c3313d3dcbb6e4e96e59e795e95c021d16efa61..4e10df16767a52b2dbb3e5dae09d7f4e716cc7d2 100644 (file)
@@ -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 ();
index cd20c2397e38331f4b4b8ed5fc58fb0cb1d37428..600092f8b41a80d72293ce794dda6b4fcee1ff75 100644 (file)
@@ -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);