[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: markup-command rounded-box is broken

From: Lukas-Fabian Moser
Subject: Re: markup-command rounded-box is broken
Date: Sun, 10 Oct 2021 10:21:27 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

So in my impression, rounded-box-stencil might deserve a refactoring anyway?

I would propose:

lukas@Aquarium:~/git/lilypond/scm(dev/lfm/rounded-box)$ git diff master
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index cb99a960fe..8b54fd048a 100644
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -960,8 +960,7 @@ c,8. c16 c4 r
         (pad (* (magstep font-size) box-padding))
         (m (interpret-markup layout props arg)))
-    (ly:stencil-add (rounded-box-stencil m th pad corner-radius)
-                    m)))
+    (rounded-box-stencil m th pad corner-radius)))

 (define-markup-command (rotate layout props ang arg)
   (number? markup?)
diff --git a/scm/stencil.scm b/scm/stencil.scm
index 0409242a05..e1df561fa6 100644
--- a/scm/stencil.scm
+++ b/scm/stencil.scm
@@ -708,12 +708,11 @@ producing a new stencil."
                  (interval-widen xext ideal-thickness)
                  (interval-widen yext ideal-thickness)
-         (inner (ly:make-stencil (ly:stencil-in-color
-                                  (ly:round-filled-box
-                                   xext yext (- ideal-blot ideal-thickness))
-                                   "white"))))
-    (set! stencil (ly:stencil-add outer inner))
-    stencil))
+         (inner (ly:stencil-in-color
+                 (ly:round-filled-box
+                 xext yext (- ideal-blot ideal-thickness))
+                 "white")))
+    (ly:stencil-add outer inner stencil)))

 (define-public (flip-stencil axis stil)
   "Flip stencil @var{stil} in the direction of @var{axis}.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]