]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/paper-system.scm
Add warning about using \relative with tagged music (3253)
[lilypond.git] / scm / paper-system.scm
index d60836199db4622ddcf9b55f182767066fc11028..8269c77e1881e01cc6df806573ecaaa88ebe1226 100644 (file)
@@ -1,6 +1,6 @@
 ;;;; This file is part of LilyPond, the GNU music typesetter.
 ;;;;
-;;;; Copyright (C) 2006--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+;;;; Copyright (C) 2006--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
 ;;;;
 ;;;; LilyPond is free software: you can redistribute it and/or modify
 ;;;; it under the terms of the GNU General Public License as published by
   (equal? #t (ly:prob-property system 'is-title)
          ))
 
+(define (system-stencil system-grob main-stencil)
+  (let* ((padding (ly:grob-property system-grob 'in-note-padding #f))
+         (in-notes (if padding (ly:grob-property system-grob 'in-note-stencil) empty-stencil))
+         (in-notes (if in-notes in-notes empty-stencil))
+         (direction (if padding (ly:grob-property system-grob 'in-note-direction) UP)))
+    (if padding
+       (ly:stencil-combine-at-edge main-stencil Y direction in-notes padding)
+       main-stencil)))
+
 (define-public (paper-system-stencil system)
-  (ly:prob-property system 'stencil))
+  (let ((main-stencil (ly:prob-property system 'stencil))
+        (system-grob (ly:prob-property system 'system-grob)))
+    (if (ly:grob? system-grob)
+        (system-stencil system-grob main-stencil)
+        main-stencil)))
 
 (define-public (paper-system-layout system)
   (let*
         (horizon-padding (and
                           (ly:grob? grob)
                           (ly:grob-property grob 'skyline-horizontal-padding 0)))
-        (padding-annotation (if next-system
+        (padding-annotation (if (skyline-pair-and-non-empty? next-system)
                                 (annotate-padding
                                   (- system-Y) system-X skyline (paper-system-extent system X)
                                   (- next-system-Y) next-system-X next-skyline (paper-system-extent next-system X)