X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frest.cc;h=8e45405de278dbd4ea5040dfc3259c6a2164a112;hb=2628c3c9950b6abbb7bd74747726f8c01340e032;hp=0bb61444b4c025882f0bb924cb531350c246102d;hpb=2944a83e59f487894a214769392ce27289accb71;p=lilypond.git diff --git a/lily/rest.cc b/lily/rest.cc index 0bb61444b4..8e45405de2 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -37,7 +37,6 @@ Rest::y_offset_callback (SCM smob) { Grob *me = unsmob_grob (smob); int duration_log = scm_to_int (me->get_property ("duration-log")); - int line_count = Staff_symbol_referencer::line_count (me); Real ss = Staff_symbol_referencer::staff_space (me); bool position_override = scm_is_number (me->get_property ("staff-position")); @@ -45,8 +44,8 @@ Rest::y_offset_callback (SCM smob) if (position_override) { - amount = - robust_scm2double (me->get_property ("staff-position"), 0) * 0.5 * ss; + amount + = robust_scm2double (me->get_property ("staff-position"), 0) * 0.5 * ss; /* semibreve rests are positioned one staff line off @@ -69,21 +68,21 @@ Rest::y_offset_callback (SCM smob) make a semibreve rest hang from the next line, except for a single line staff */ - if (duration_log == 0 && line_count > 1) + if (duration_log == 0 && Staff_symbol_referencer::line_count (me) > 1) pos += 2; /* make sure rest is aligned to a staff line */ - if (Grob *staff = Staff_symbol_referencer::get_staff_symbol(me)) + if (Grob *staff = Staff_symbol_referencer::get_staff_symbol (me)) { std::vector linepos = Staff_symbol::line_positions (staff); - std::sort(linepos.begin(), linepos.end()); + std::sort (linepos.begin (), linepos.end ()); std::vector::const_iterator it - = std::lower_bound(linepos.begin(), linepos.end(), pos); - if (it != linepos.end()) + = std::lower_bound (linepos.begin (), linepos.end (), pos); + if (it != linepos.end ()) { - pos = (int)ceil(*it); + pos = (int)ceil (*it); } } @@ -127,8 +126,8 @@ Rest::glyph_name (Grob *me, int durlog, string style, bool try_ledgers) */ if (-1 <= durlog && durlog <= 1) is_ledgered = !Staff_symbol_referencer::on_staff_line (me, pos) - && !(durlog == -1 - && Staff_symbol_referencer::on_staff_line (me, pos + 2)); + && !(durlog == -1 + && Staff_symbol_referencer::on_staff_line (me, pos + 2)); } string actual_style (style.c_str ());