From: Joe Neeman Date: Sat, 17 Sep 2011 03:00:18 +0000 (-0700) Subject: Fix 1598. X-Git-Tag: release/2.15.12-1~35 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5670dc898dbedc105b5ff0719959317850ef443d;p=lilypond.git Fix 1598. Don't include non-spaceable lines in the extent calculations for InstrumentName. --- diff --git a/input/regression/instrument-name-pedal-lyrics.ly b/input/regression/instrument-name-pedal-lyrics.ly new file mode 100644 index 0000000000..2dc1da8274 --- /dev/null +++ b/input/regression/instrument-name-pedal-lyrics.ly @@ -0,0 +1,40 @@ +\version "2.15.12" + +\header { + texidoc = "@code{Dynamics} and @code{Lyrics} lines below +a @code{PianoStaff} do not affect the placement of the instrument name." +} + +upper = \relative c'' { + a4 b c d +} + +lower = \relative c { + \clef bass + a2 c +} + +\score { +<< + \new PianoStaff + << + \set PianoStaff.instrumentName = #"Piano" + \new Staff = "Staff_pfUpper" << \upper >> + \new Staff = "Staff_pfLower" << \lower >> + \new Dynamics { s2\sustainOn s\sustainOff } + >> + + \new PianoStaff << + \set PianoStaff.instrumentName = #"Piano" + \new Staff = "Staff_pfUpper" << \upper >> + \new Staff = "Staff_pfLower" << \lower >> + \new Lyrics \lyricmode { la2 la2 } + >> + + \new PianoStaff << + \set PianoStaff.instrumentName = #"Piano" + \new Staff = "Staff_pfUpper" << \upper >> + \new Staff = "Staff_pfLower" << \lower >> + >> +>> +} \ No newline at end of file diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index e3214069b3..c453e95411 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -17,13 +17,14 @@ along with LilyPond. If not, see . */ +#include "align-interface.hh" +#include "axis-group-interface.hh" #include "engraver.hh" +#include "page-layout-problem.hh" #include "pointer-group-interface.hh" #include "side-position-interface.hh" -#include "axis-group-interface.hh" -#include "align-interface.hh" -#include "text-interface.hh" #include "system.hh" +#include "text-interface.hh" #include "translator.icc" @@ -125,6 +126,7 @@ 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. */