]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.27
authorfred <fred>
Sun, 24 Mar 2002 20:01:17 +0000 (20:01 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:01:17 +0000 (20:01 +0000)
lily/include/lookup.hh
lily/lookup.cc
lily/note-head.cc

index d4f8663c35dbdda5a4091a6089cc0bfdbb4779b8..d0616359e28133e356a12538cc3e6e3d300442e9 100644 (file)
@@ -31,12 +31,7 @@ struct Lookup {
     /// round slope to closest TeXslope
     Atom beam (Real&,Real) const;
 
-    /**
-      pos == 3 : 3 lines above staff (extending below note)
-
-      pos == -3: below staff
-      */
-    Atom streepjes (int type, int pos) const;
+    Atom streepje (int type) const;
 
     Atom vbrace (Real &dy) const;
     Atom meter (Array<Scalar>) const;
index 9b7ec861c446e54b0402a0ef8cef525ed3d021c9..bf432c3d11ded94572273d60d8b4c73da18559cf 100644 (file)
@@ -145,35 +145,14 @@ Lookup::flag (int j, Direction d) const
 }
 
 Atom
-Lookup::streepjes (int type, int i) const
+Lookup::streepje (int type) const
 {
-  assert (i);
+  if (type > 2)
+    type = 2;
 
-  int arg;
-  String idx;
-
-  if (i < 0)
-    {
-      idx = "botlines";
-      arg = -i;
-    }
-  else
-    {
-      arg = i;
-      idx = "toplines";
-    }
-
-  // ugh
-  Real w = ball (type).dim_[X_AXIS].length ();
-
-  Atom ret = (*symtables_)("streepjes")->lookup (idx);
-
-  Array<String> a;
-  a.push (String (w) + "pt");
-  a.push (arg);
-  ret.tex_ = substitute_args (ret.tex_, a);
-
-  return ret;
+  Symtable * st = (*symtables_)("balls");
+  
+  return st->lookup (String (type) + 'l');
 }
 
 Atom
index 529e28d895a7b31c9cd9136b55cb1268858c8a2a..7a728aaa82e406bed48586cdd1c4528a9e53d864 100644 (file)
@@ -61,7 +61,7 @@ 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;
   
@@ -72,14 +72,18 @@ Note_head::brew_molecule_p() const
   if (streepjes_i) 
     {
       int dir = sign (position_i_);
+      Atom streepje = p->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 (s);
+       }
     }
   
   out->translate_axis (inter_f*position_i_, Y_AXIS);