]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/stem.cc
release: 1.5.29
[lilypond.git] / lily / stem.cc
index 8502c7581c558ccf8c1ffa2e97900cacb980135c..f02c00598ad430328582aa5eca8324e26145dad3 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1996--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
     Jan Nieuwenhuizen <janneke@gnu.org>
 
   TODO: This is way too hairy
@@ -82,7 +82,6 @@ Stem::stem_end_position (Grob*me)
   Real pos;
   if (!gh_number_p (p))
     {
-
       pos = get_default_stem_end_position (me);
       me->set_grob_property ("stem-end-position", gh_double2scm (pos));
     }
@@ -228,7 +227,7 @@ Stem::add_head (Grob*me, Grob *n)
 
   if (Note_head::has_interface (n))
     {
-      Pointer_group_interface::add_element (me, ly_symbol2scm ("heads"), n);
+      Pointer_group_interface::add_grob (me, ly_symbol2scm ("heads"), n);
     }
   else
     {
@@ -380,7 +379,7 @@ Stem::position_noteheads (Grob*me)
     return;
   
   Link_array<Grob> heads =
-    Pointer_group_interface__extract_elements (me, (Grob*)0, "heads");
+    Pointer_group_interface__extract_grobs (me, (Grob*)0, "heads");
 
   heads.sort (compare_position);
   Direction dir =get_direction (me);
@@ -434,11 +433,9 @@ Stem::before_line_breaking (SCM smob)
       // suicide ();
     }
   
-  set_spacing_hints (me);
   return SCM_UNSPECIFIED;
 }
 
-
 /*
   ugh.
   When in a beam with tuplet brackets, brew_mol is called early,
@@ -460,31 +457,6 @@ Stem::height (SCM smob, SCM ax)
 }
 
 
-/**
-   set stem directions for hinting the optical spacing correction.
-
-   Modifies DIR_LIST property of the Stem's Paper_column
-
-   TODO: more advanced: supply height of noteheads as well, for more advanced spacing possibilities
- */
-void
-Stem::set_spacing_hints (Grob*me) 
-{
-  if (!invisible_b (me))
-    {
-      SCM scmdir  = gh_int2scm (get_direction (me));
-
-      Item* item = dynamic_cast<Item*> (me);
-      Item * col =  item->column_l ();
-      SCM dirlist =col->get_grob_property ("dir-list");
-      if (scm_c_memq (scmdir, dirlist) == SCM_BOOL_F)
-       {
-         dirlist = gh_cons (scmdir, dirlist);
-         col->set_grob_property ("dir-list", dirlist);
-       }
-    }
-}
-
 Molecule
 Stem::flag (Grob*me)
 {
@@ -591,7 +563,7 @@ Stem::brew_molecule (SCM smob)
 
   // dy?
   Real dy = Staff_symbol_referencer::staff_space (me) * 0.5;
-    
+
   if (Grob *hed = support_head (me))
     {
       /*
@@ -601,7 +573,7 @@ Stem::brew_molecule (SCM smob)
       Real y_attach = Note_head::stem_attachment_coordinate ( hed, Y_AXIS);
 
       y_attach = head_height.linear_combination (y_attach);
-      stem_y[Direction (-d)] += d * 2*y_attach;
+      stem_y[Direction (-d)] += d * y_attach/dy;
     }
   
   if (!invisible_b (me))