]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix 1598.
authorJoe Neeman <joeneeman@gmail.com>
Sat, 17 Sep 2011 03:00:18 +0000 (20:00 -0700)
committerJoe Neeman <joeneeman@gmail.com>
Sat, 17 Sep 2011 03:00:18 +0000 (20:00 -0700)
Don't include non-spaceable lines in the extent calculations for InstrumentName.

input/regression/instrument-name-pedal-lyrics.ly [new file with mode: 0644]
lily/instrument-name-engraver.cc

diff --git a/input/regression/instrument-name-pedal-lyrics.ly b/input/regression/instrument-name-pedal-lyrics.ly
new file mode 100644 (file)
index 0000000..2dc1da8
--- /dev/null
@@ -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
index e3214069b3955bc3602c7b43ead87c33b410d8b0..c453e95411053eed99d8492a56a2b1a90843565b 100644 (file)
   along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#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<Spanner *> (info.grob ())
       && Axis_group_interface::has_axis (info.grob (), Y_AXIS)
+      && Page_layout_problem::is_spaceable (info.grob ())
 
       /* ugh. */