From: fred Date: Sun, 24 Mar 2002 19:39:14 +0000 (+0000) Subject: lilypond-0.0.51 X-Git-Tag: release/1.5.59~4961 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=e0356a78942f16be7576ae3e7b41ad2d4259dd79;p=lilypond.git lilypond-0.0.51 --- diff --git a/lily/staff-side.cc b/lily/staff-side.cc index 92b7917acb..0bf26223ab 100644 --- a/lily/staff-side.cc +++ b/lily/staff-side.cc @@ -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)); }