]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.51
authorfred <fred>
Sun, 24 Mar 2002 19:39:14 +0000 (19:39 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:39:14 +0000 (19:39 +0000)
lily/staff-side.cc

index 92b7917acb3a533797cd521324631f517967512c..0bf26223ab05777ddebf629fe366ac22692fb23e 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "staff-side.hh"
 #include "staff-sym.hh"
+#include "debug.hh"
 
 void
 Staff_side::set_staffsym(Staff_symbol* s_l)
@@ -43,6 +44,10 @@ Staff_side::get_position_i()const
 {
     if (!staff_sym_l_)
        return 0;
+    if (!dir_i_) {
+       warning("Staff_side::get_position_i(): returning -20");
+       return -20;
+    }
     
     Real inter_f = staff_sym_l_->inter_note_f();
     int staff_size_i = staff_sym_l_->steps_i();
@@ -61,5 +66,21 @@ Staff_side::get_position_i()const
        Interval v= support_height();
        y = v[dir_i_]  + 2*dir_i_*inter_f;      // ugh
     }
-    return int(rint(Real(y)/inter_f));
+    return int(rint(Real(y)/inter_f)); // should ret a float?
+}
+
+int
+Staff_side::get_position_i(Interval sym_dim) const
+{ 
+    if (!staff_sym_l_)
+       return 0;
+   if (!dir_i_) {
+       warning("Staff_side::get_position_i(): returning -20");
+       return -20;
+    }
+   
+    Real inter_f = staff_sym_l_->inter_note_f();
+  
+    int i= get_position_i();
+    return i+ int(rint(- sym_dim[dir_i_] / inter_f));
 }