Hi,

2014-11-29 1:15 GMT+01:00 Big Noise <[email protected]>:


> Here is my problem:
> Now the staff lines and the yellow rectangle are located in the same
> layer, so it's not possible to place the blue cluster between them.
> Is there a way to make the scheme function put the staff lines
> ("StaffSymbol") and the yellow rectangle into different layers?
>


How about changing the layer value from -10 to -2 ?

bgColor =
#(define-music-function (parser location y-lower y-upper color) (number?
number? string?)
   #{
     \stopStaff
     \override Staff.StaffSymbol.stencil =
     $(lambda (grob)
        (let* ((staff (ly:staff-symbol::print grob))
               (X-ext (ly:stencil-extent staff X))
               (Y-ext (ly:stencil-extent staff Y)))
          (set! Y-ext (cons
                       (- (car Y-ext) y-lower)
                       (+ (cdr Y-ext) y-upper)))
          ;; change layer's value to -2
          (ly:grob-set-property! grob 'layer -2)
          (ly:stencil-add
           (ly:make-stencil (list 'color (eval-string color)
                              (ly:stencil-expr (ly:round-filled-box X-ext
Y-ext 0))
                              X-ext Y-ext))
           staff)))
     \startStaff
   #})

HTH
Pierre
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to