]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/stencil.scm
Merge remote branch 'origin/release/unstable' into HEAD
[lilypond.git] / scm / stencil.scm
index e64cc2b91c8662fad2736fd71d5fc56bb5a0ca48..fb2809e9fd2fee40c1d98660f7f10ac5ccf4711d 100644 (file)
@@ -159,7 +159,7 @@ the more angular the shape of the parenthesis."
       upper-end-point
       ;; Step 1: move to lower end point.
       lower-end-point)
-     (* 2 half-thickness)
+     (min (* 2 half-thickness) line-width)
      (interval-widen x-extent (/ line-width 2))
      (interval-widen y-extent (/ line-width 2)))))
 
@@ -737,15 +737,17 @@ we make between 0 and 2*pi."
               `(delay-stencil-evaluation ,(delay whiteout-expr)))
             stil)))))
 
-(define-public (stencil-whiteout-box stencil)
+(define*-public (stencil-whiteout-box stencil
+                 #:optional (thickness 0) (blot 0) (color white))
+  "@var{thickness} is how far in staff-spaces the white outline
+extends past the extents of @var{stencil}."
   (let*
-      ((x-ext (ly:stencil-extent stencil X))
-       (y-ext (ly:stencil-extent stencil Y)))
+   ((x-ext (interval-widen (ly:stencil-extent stencil X) thickness))
+    (y-ext (interval-widen (ly:stencil-extent stencil Y) thickness)))
 
-    (ly:stencil-add
-     (stencil-with-color (ly:round-filled-box x-ext y-ext 0.0)
-                         white)
-     stencil)))
+   (ly:stencil-add
+    (stencil-with-color (ly:round-filled-box x-ext y-ext blot) color)
+    stencil)))
 
 (define-public (arrow-stencil-maker start? end?)
   "Return a function drawing a line from current point to @code{destination},