X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fstaff-symbol-referencer.cc;h=ffad2e6fdd4c7bd07e8f0d69c76025a650a496cb;hb=9e781b7dc83b60a543ce218aa1a5f139f74c760f;hp=b18bb04fa3b8f7f2dd6b8d60206e09ac2fb08863;hpb=6a1a605d8235d799c5f19f334c9341e19e2d587c;p=lilypond.git diff --git a/lily/staff-symbol-referencer.cc b/lily/staff-symbol-referencer.cc index b18bb04fa3..ffad2e6fdd 100644 --- a/lily/staff-symbol-referencer.cc +++ b/lily/staff-symbol-referencer.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1999--2012 Han-Wen Nienhuys + Copyright (C) 1999--2014 Han-Wen Nienhuys LilyPond is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -189,11 +189,23 @@ Staff_symbol_referencer::internal_set_position (Grob *me, Real p, bool pure) me->translate_axis ((p - oldpos) * ss * 0.5, Y_AXIS); } -/* Half of the height, in staff space, i.e. 2.0 for a normal staff. */ +Interval +Staff_symbol_referencer::staff_span (Grob *me) +{ + Interval result; + if (me) + if (Grob *symb = get_staff_symbol (me)) + result = Staff_symbol::line_span (symb); + return result; +} + Real Staff_symbol_referencer::staff_radius (Grob *me) { - return (line_count (me) - 1) / 2.0; + /* + line_span is measured in pitch steps, not in staff spaces + */ + return staff_span (me).length () / 4.0; } int