]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/output-lib.scm
Issue 4528/2 Add regression tests for ssaattbb.ly built-in template
[lilypond.git] / scm / output-lib.scm
index a73e2c0324977e6046d45c8cfb736bd59ec4c644..8a5cae2b23f0fbcc79ab61c6334dd0222b115380 100644 (file)
@@ -902,15 +902,28 @@ and duration-log @var{log}."
     (set! rp (ly:make-stencil (ly:stencil-expr rp)
                               rp-x-extent
                               (ly:stencil-extent rp Y)))
-    (list (stencil-whiteout lp)
-          (stencil-whiteout rp))))
+    (list (stencil-whiteout-box lp)
+          (stencil-whiteout-box rp))))
+
+(define-public (parentheses-item::y-extent grob) (ly:grob::stencil-height grob))
 
 (define (parenthesize-elements grob . rest)
   (let* ((refp (if (null? rest)
                    grob
                    (car rest)))
-         (elts (ly:grob-object grob 'elements))
-         (x-ext (ly:relative-group-extent elts refp X))
+         (elts (ly:grob-array->list (ly:grob-object grob 'elements)))
+         (get-friends
+           (lambda (g)
+             (let ((syms (ly:grob-property g 'parenthesis-friends '()))
+                   (get-friend (lambda (s)
+                                 (let ((f (ly:grob-object g s)))
+                                   (cond
+                                     ((ly:grob? f) (list f))
+                                     ((ly:grob-array? f) (ly:grob-array->list f))
+                                     (else '()))))))
+               (apply append (map get-friend syms)))))
+         (friends (apply append elts (map get-friends elts)))
+         (x-ext (ly:relative-group-extent friends refp X))
          (stencils (ly:grob-property grob 'stencils))
          (lp (car stencils))
          (rp (cadr stencils))