X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fledger-line-spanner.cc;h=b0e8fee3c2321b8e7f078a7946048714deca168a;hb=c832deb4718dfdc8bb8518e2872271cfe38b7dec;hp=d36f908b2c81d78aae69d3b1b8136500350b961d;hpb=f0fe9c843e926066299c1f9a33004649f42e1f24;p=lilypond.git diff --git a/lily/ledger-line-spanner.cc b/lily/ledger-line-spanner.cc index d36f908b2c..b0e8fee3c2 100644 --- a/lily/ledger-line-spanner.cc +++ b/lily/ledger-line-spanner.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 2004--2012 Han-Wen Nienhuys + Copyright (C) 2004--2015 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 @@ -32,7 +32,6 @@ struct Ledger_line_spanner { DECLARE_SCHEME_CALLBACK (print, (SCM)); DECLARE_SCHEME_CALLBACK (set_spacing_rods, (SCM)); - DECLARE_GROB_INTERFACE (); }; static void @@ -66,7 +65,7 @@ MAKE_SCHEME_CALLBACK (Ledger_line_spanner, set_spacing_rods, 1); SCM Ledger_line_spanner::set_spacing_rods (SCM smob) { - Spanner *me = dynamic_cast (unsmob_grob (smob)); + Spanner *me = unsmob (smob); // find size of note heads. Grob *staff = Staff_symbol_referencer::get_staff_symbol (me); @@ -100,7 +99,7 @@ Ledger_line_spanner::set_spacing_rods (SCM smob) Item *h = heads[i]; int pos = Staff_symbol_referencer::get_rounded_position (h); - if (staff_extent.contains (pos)) + if (Staff_symbol::ledger_positions (staff, pos).empty ()) continue; /* Ambitus heads can appear out-of-order in heads[], @@ -164,7 +163,7 @@ MAKE_SCHEME_CALLBACK (Ledger_line_spanner, print, 1); SCM Ledger_line_spanner::print (SCM smob) { - Spanner *me = dynamic_cast (unsmob_grob (smob)); + Spanner *me = unsmob (smob); extract_grob_set (me, "note-heads", heads); @@ -193,7 +192,7 @@ Ledger_line_spanner::print (SCM smob) Axis a = Axis (i); common[a] = common_refpoint_of_array (heads, me, a); for (vsize i = heads.size (); i--;) - if (Grob *g = unsmob_grob (me->get_object ("accidental-grob"))) + if (Grob *g = unsmob (me->get_object ("accidental-grob"))) common[a] = common[a]->common_refpoint (g, a); } @@ -287,7 +286,7 @@ Ledger_line_spanner::print (SCM smob) Interval x_extent = ledger_size; if (i == 0) - if (Grob *g = unsmob_grob (h->get_object ("accidental-grob"))) + if (Grob *g = unsmob (h->get_object ("accidental-grob"))) { Interval accidental_size = g->extent (common[X_AXIS], X_AXIS); Real d @@ -326,19 +325,19 @@ Ledger_line_spanner::print (SCM smob) ADD_INTERFACE (Ledger_line_spanner, "This spanner draws the ledger lines of a staff. This is a" " separate grob because it has to process all potential" - " collisions between all note heads.", + " collisions between all note heads. The thickness of ledger" + " lines is controlled by the @code{ledger-line-thickness}" + " property of the @ref{StaffSymbol} grob.", /* properties */ "gap " "length-fraction " "minimum-length-fraction " "note-heads " - "thickness " ); struct Ledgered_interface { - DECLARE_GROB_INTERFACE (); }; ADD_INTERFACE (Ledgered_interface,