X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Finstrument-name-engraver.cc;h=cfeed05d5362dce697de93d8d0e619ecc54d47ee;hb=3930746d3e6cab846a02332c39510c48027c6006;hp=c453e95411053eed99d8492a56a2b1a90843565b;hpb=3c6e2cd4a550aacc3b64e0b38882c469850e073d;p=lilypond.git diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index c453e95411..cfeed05d53 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -40,6 +40,7 @@ protected: SCM short_text_; vector axis_groups_; + vector backup_axis_groups_; virtual void finalize (); DECLARE_ACKNOWLEDGER (axis_group); @@ -126,7 +127,6 @@ Instrument_name_engraver::acknowledge_axis_group (Grob_info info) { if (dynamic_cast (info.grob ()) && Axis_group_interface::has_axis (info.grob (), Y_AXIS) - && Page_layout_problem::is_spaceable (info.grob ()) /* ugh. */ @@ -135,7 +135,13 @@ Instrument_name_engraver::acknowledge_axis_group (Grob_info info) && !info.grob ()->internal_has_interface (ly_symbol2scm ("volta-interface")) && (!Align_interface::has_interface (info.grob ()))) { - axis_groups_.push_back (info.grob ()); + if (Page_layout_problem::is_spaceable (info.grob ())) + axis_groups_.push_back (info.grob ()); + else + // By default, don't include non-spaceable staves in the + // support of an instrument name. However, if the only staves + // are non-spaceable, we'll fall back to using them. + backup_axis_groups_.push_back (info.grob ()); } } @@ -149,6 +155,9 @@ Instrument_name_engraver::finalize () void Instrument_name_engraver::stop_spanner () { + if (axis_groups_.empty ()) + axis_groups_ = backup_axis_groups_; + for (vsize i = 0; i < axis_groups_.size (); i++) Pointer_group_interface::add_grob (text_spanner_, ly_symbol2scm ("elements"),