[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: markup-command rounded-box is broken
From: |
Thomas Morley |
Subject: |
Re: markup-command rounded-box is broken |
Date: |
Sun, 10 Oct 2021 10:51:38 +0200 |
Am So., 10. Okt. 2021 um 10:21 Uhr schrieb Lukas-Fabian Moser <lfm@gmx.de>:
>
>
> > 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
> thickness))
> (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)
> ideal-blot))
> - (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}.
>
> Lukas
>
Hi Lukas,
this would have the advantage to be inline with the doc-string and
solve the issue at hand.
Though, speaking of refactoring rounded-box-stencil.
It always bugs me to see some stencil overlaying to get a simple line.
Here it leads to different behaviour of \box and \rounded-box:
\markup
\overlay {
\stencil
#(stencil-with-color (make-filled-box-stencil '(-1 . 4) '(-1 . 3)) red)
\rounded-box "foo"
}
\markup
\overlay {
\stencil
#(stencil-with-color (make-filled-box-stencil '(-1 . 4) '(-1 . 3)) red)
\box "foo"
}
Though, I've no good idea how to improve it.
Cheers,
Harm
Re: markup-command rounded-box is broken, James, 2021/10/10