]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/staff-side.cc
release: 0.0.70pre
[lilypond.git] / lily / staff-side.cc
index 562b6c3d277b4adbd8a44fd238a3431e0d02a2d9..e7d8ccebf6cec936aa5c32704a256040e6b75bd1 100644 (file)
@@ -6,6 +6,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
+#include "interval.hh"
 #include "paper-def.hh"
 #include "dimen.hh"
 #include "staff-side.hh"
@@ -16,6 +17,7 @@ void
 Staff_side::set_staffsym(Staff_symbol* s_l)
 {
     staff_sym_l_ = s_l;
+    add_dependency( s_l );
 }
 
 Staff_side::Staff_side()
@@ -88,12 +90,15 @@ int
 Staff_side::get_position_i(Interval sym_dim) const
 { 
     int i= get_position_i();
-    return i+ int(rint(- sym_dim[-dir_i_] / paper()->internote_f()));
+    if (dir_i_)
+       return i+ int(rint(- sym_dim[-dir_i_] / paper()->internote_f()));
+    else
+       return i;
 }
 
 
 void
-Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n )
+Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n)
 { 
     int i;
     while ((i=support_l_arr_.find_i(o) ) >=0)
@@ -105,3 +110,6 @@ Staff_side::do_substitute_dependency(Score_elem*o, Score_elem*n )
     if (staff_sym_l_ == o)
        staff_sym_l_ = n ? (Staff_symbol*) n->spanner():0;
 }
+
+IMPLEMENT_STATIC_NAME(Staff_side);
+IMPLEMENT_IS_TYPE_B1(Staff_side, Score_elem);