]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-side.cc
release: 0.1.61
[lilypond.git] / lily / staff-side.cc
index 06690a0334b272ca4374cba4745da024ab58b628..7b99d06f998516627239d984f1fc5a4bc67f3a16 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  (c)  1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
 #include "interval.hh"
@@ -19,7 +19,6 @@ Staff_side::Staff_side()
   y_=0;
   sym_int_ = Interval (0,0);
   dir_ = CENTER;
-  inside_staff_b_ = false;
 }
 
 
@@ -54,22 +53,33 @@ Staff_side::add_support (Score_elem*i)
 }
 
 Real
-Staff_side::get_position_f() const
+Staff_side::get_position_f () const
 {
   if (!dir_)
     {
-      warning (_("Staff_side::get_position_i(): "
+      warning (_("Staff_side::get_position_f(): "
                 "somebody forgot to set my vertical direction, returning -20"));
       return -20;
     }
 
 
-  Real y=0;
+  Real y = 0;
   Real inter_f = paper()-> internote_f ();
 
-  Interval v= support_height();
-//  y = v[dir_]  + 2*dir_*inter_f;     // ugh
-  y = v[dir_]; // ugh
+  Interval v = support_height();
+
+  // ugh, dim[y] = PT over here
+  y = v[dir_] + 1 * dir_ * inter_f;
+
+  int y_i = (int)rint (y / inter_f);
+  // ugh: 5 -> staff_lines
+  if (abs (y_i) < 5)
+    {
+      if (!(abs (y_i) % 2))
+       y += (Real)dir_ * inter_f;
+    }
+//  else
+//    y = v[dir_] + 1 * dir_ * inter_f;
 
   return y;
 }