]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/note-head.cc
release: 1.0.1
[lilypond.git] / lily / note-head.cc
index 529e28d895a7b31c9cd9136b55cb1268858c8a2a..00539b06d072e0e90c7cd85099e09f5756d368ba 100644 (file)
@@ -3,13 +3,13 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "misc.hh"
 #include "dots.hh"
 #include "note-head.hh"
-#include "dimen.hh" 
+#include "dimension.hh" 
 #include "debug.hh"
 #include "paper-def.hh"
 #include "lookup.hh"
@@ -47,7 +47,7 @@ Note_head::compare (Note_head *const  &a, Note_head * const &b)
 Interval
 Note_head::do_width () const
 {
-  Atom a =  paper ()->lookup_l()->ball (balltype_i_);
+  Atom a =  lookup_l ()->ball (balltype_i_);
   Interval i = a.dim_[X_AXIS];
   i+= x_dir_ * i.length ();
   return i;
@@ -61,25 +61,29 @@ Note_head::brew_molecule_p() const
   Real inter_f = p->internote_f ();
 
   // ugh
-  int streepjes_i = abs(position_i_) < staff_size_i_/2 
+  int streepjes_i = abs (position_i_) < staff_size_i_/2 
     ? 0
     : (abs(position_i_) - staff_size_i_/2) /2;
   
-  Atom  s = p->lookup_l()->ball (balltype_i_);
+  Atom  s = lookup_l()->ball (balltype_i_);
   out = new Molecule (Atom (s));
   out->translate_axis (x_dir_ * s.dim_[X_AXIS].length (), X_AXIS);
 
   if (streepjes_i) 
     {
       int dir = sign (position_i_);
+      Atom streepje = lookup_l ()->streepje (balltype_i_);
+      
+      int parity =  (position_i_ % 2) ? 1 : 0;
        
-      Atom streepje = p->lookup_l()->streepjes (balltype_i_, dir* streepjes_i);
-
-      Molecule sm;
-      sm.add (streepje);
-      if (position_i_ % 2)
-       sm.translate_axis (-inter_f* dir, Y_AXIS);
-      out->add (sm);
+      
+      for (int i=0; i < streepjes_i; i++)
+       {
+         Atom s = streepje;
+         s.translate_axis (-dir * inter_f * (i*2 + parity),
+                          Y_AXIS);
+         out->add_atom (s);
+       }
     }
   
   out->translate_axis (inter_f*position_i_, Y_AXIS);