X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fmulti-measure-rest.cc;h=c0f26f5c857c394f1db2de658594919de77e5414;hb=c038b41688cbfba042deb80f790b560a69813705;hp=82c56020545c3ef9fd68714c6dedc929032d5262;hpb=fcfeacd25974cdc37bf9eb65d72902e56511b282;p=lilypond.git diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 82c5602054..c0f26f5c85 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1998--2011 Jan Nieuwenhuizen + Copyright (C) 1998--2012 Jan Nieuwenhuizen LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -42,8 +42,7 @@ Multi_measure_rest::bar_width (Spanner *me) { SCM spacing_pair = me->get_property ("spacing-pair"); Interval iv; - Direction d = LEFT; - do + for (LEFT_and_RIGHT (d)) { Item *col = me->get_bound (d)->get_column (); SCM align_sym @@ -54,7 +53,6 @@ Multi_measure_rest::bar_width (Spanner *me) iv[d] = coldim[-d]; } - while (flip (&d) != LEFT); return iv; } @@ -205,16 +203,20 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space) return s; } - Real staff_space = Staff_symbol_referencer::staff_space (me); - Font_metric *musfont = Font_interface::get_default_font (me); int mdl = calc_measure_duration_log (me, true); if (measure_count == 1) { - Stencil s = musfont->find_by_name (Rest::glyph_name (me, mdl, "", true)); if (mdl == 0 && me->get_property ("staff-position") == SCM_EOL) - s.translate_axis (staff_space, Y_AXIS); + { + if (Staff_symbol_referencer::on_staff_line (me, 2)) + me->set_property ("staff-position", scm_from_int (2)); + else if (Staff_symbol_referencer::on_staff_line (me, 3)) + me->set_property ("staff-position", scm_from_int (3)); + } + + Stencil s = musfont->find_by_name (Rest::glyph_name (me, mdl, "", true)); s.translate_axis ((space - s.extent (X_AXIS).length ()) / 2, X_AXIS); return s;