]> git.donarmstrong.com Git - lilypond.git/commitdiff
Fix #789.
authorNeil Puttock <n.puttock@gmail.com>
Mon, 7 Dec 2009 23:28:08 +0000 (23:28 +0000)
committerNeil Puttock <n.puttock@gmail.com>
Mon, 7 Dec 2009 23:28:08 +0000 (23:28 +0000)
* filter out VoltaLineSpanner axis groups from acknowledger in
  Instrument_name_engraver.  This prevents instrument names from
  being misaligned when the Volta_engraver is moved to the Staff context
  and the spanner is broken (where its left bound would
  be the same NonMusicalPaperColumn as the InstrumentName's.)

* add regression test

input/regression/instrument-name-volta.ly [new file with mode: 0644]
lily/instrument-name-engraver.cc
scm/define-grob-interfaces.scm
scm/define-grobs.scm

diff --git a/input/regression/instrument-name-volta.ly b/input/regression/instrument-name-volta.ly
new file mode 100644 (file)
index 0000000..529f787
--- /dev/null
@@ -0,0 +1,40 @@
+\version "2.13.9"
+
+\header {
+  texidoc = "Moving the @code{Volta_engraver} to the @code{Staff}
+context does not affect @code{InstrumentName} alignment."
+}
+
+testMusik =  \relative c'' {
+  \repeat volta 2 {
+    c1 \break
+  } \alternative {
+    { c1 \break }
+    { c1 \break }
+  }
+}
+
+\score {
+  \new Staff \relative c' {
+    \set Staff.shortInstrumentName = #"Instr."
+    \repeat volta 2 {
+      c1 \break
+    }
+    \alternative {
+      { c1 \break }
+      { c1 \break }
+    }
+  }
+}
+\layout {
+  ragged-right = ##t
+  short-indent = 5\mm
+  \context {
+    \Score
+    \remove "Volta_engraver"
+  }
+  \context {
+    \Staff
+    \consists "Volta_engraver"
+  }
+}
index f39677ffffcb0774be2b32142964e8ff21ee9abf..7bdfc428e872ff531fd2612cce18198d3e08ef42 100644 (file)
@@ -121,6 +121,7 @@ Instrument_name_engraver::acknowledge_axis_group (Grob_info info)
 
       && !info.grob ()->internal_has_interface (ly_symbol2scm ("dynamic-interface"))
       && !info.grob ()->internal_has_interface (ly_symbol2scm ("piano-pedal-interface"))
+      && !info.grob ()->internal_has_interface (ly_symbol2scm ("volta-interface"))
       && (!Align_interface::has_interface (info.grob ())))
     {
       axis_groups_.push_back (info.grob ());
@@ -164,8 +165,8 @@ ADD_TRANSLATOR (Instrument_name_engraver,
                
                /* read */
                "currentCommandColumn "
-               "shortInstrumentName "
                "instrumentName "
+               "shortInstrumentName "
                "shortVocalName "
                "vocalName ",
 
index 50f9d6794cda769d7a4603e6b5cca0ea0040dfb4..d0abebed7bb753585bbf018f3de3e5a90324f0eb 100644 (file)
@@ -214,3 +214,8 @@ with @code{breakable=##t}."
  "Objects that should be kept at constant vertical distances.  Typically:
 @rinternals{VerticalAxisGroup} objects of @rinternals{Staff} contexts."
  '())
+
+(ly:add-interface
+ 'volta-interface
+ "A volta repeat."
+ '())
index 6ed7eec234b1132a841375e0463982ed25a0e8dc..802774e3f2caf15614d49fc3c719e87496fec366 100644 (file)
        (font-encoding . fetaNumber)
        (font-size . -4)
        (stencil . ,ly:volta-bracket-interface::print)
-       (thickness . 1.6)  ;;  line-thickness
+       (thickness . 1.6) ;; line-thickness
        (word-space . 0.6)
        (meta . ((class . Spanner)
                 (interfaces . (font-interface
                                line-interface
                                side-position-interface
                                text-interface
-                               volta-bracket-interface))))))
+                               volta-bracket-interface
+                               volta-interface))))))
 
     (VoltaBracketSpanner
      . (
        (after-line-breaking . ,ly:side-position-interface::move-to-extremal-staff)
        (axes . (,Y))
        (direction . ,UP)
-       (no-alignment . ,#t)
+       (no-alignment . #t)
        (outside-staff-priority . 600)
        (padding . 1)
        (side-axis . ,Y)
        (Y-offset . ,ly:side-position-interface::y-aligned-side)
        (meta . ((class . Spanner)
                 (interfaces . (axis-group-interface
-                               side-position-interface))))))
+                               side-position-interface
+                               volta-interface))))))
 
 ))
 
    ly:text-interface::print
    ly:script-interface::print))
 
-;; ly:grob::stencil-extent is safe iff the print callback is safe too
+;; ly:grob::stencil-extent is safe if the print callback is safe too
 (define (pure-stencil-height grob start stop)
   (let ((sten (ly:grob-property-data grob 'stencil)))
     (if (or