From a06d0e07f0e87a0f16270b08914f8070df349f6e Mon Sep 17 00:00:00 2001 From: Valentin Villenave Date: Mon, 21 Apr 2008 20:05:33 +0200 Subject: [PATCH] \rounded-box, final take Small corrections (backslashes escaping, corner-radius property implementation, and correction of default thickness) --- scm/define-grob-properties.scm | 4 ++++ scm/define-markup-commands.scm | 2 +- scm/stencil.scm | 13 ++++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index 3fb91c199e..c767e09a71 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -152,6 +152,10 @@ this grob looks as a continued break.") (control-points ,list? "List of offsets (number pairs) that form control points for the tie, slur, or bracket shape. For B@'eziers, this should list the control points of a third-order B@'ezier curve.") + (corner-radius ,number? "The diameter of a blot, in rounded +boxes. If set to #0, the corners will we completely sharp; default is +#1. If set to a too big value, it will be ignored and the shortest +edges of the box will be drawn as semicircles." (damping ,number? "Amount of beam slope damping.") (dash-fraction ,number? "Size of the dashes, relative to diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index e5d7196cd1..3ec32d7335 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -209,7 +209,7 @@ thickness and padding around the markup; the @code{corner-radius} property makes possible to define another shape for the corners (default is 1). @lilypond[quote,verbatim,fragment,relative=2] -c^\markup{ \rounded-box Overtura } +c^\\markup{ \\rounded-box Overtura } c,8. c16 c4 r @end lilypond" (let* ((th (* diff --git a/scm/stencil.scm b/scm/stencil.scm index 3256d49f61..536425b9c6 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -138,13 +138,12 @@ encloses the contents. (ideal-blot (min blot (/ min-ext 2))) (ideal-thickness (min thickness (/ min-ext 2))) (outer (ly:round-filled-box - (interval-widen xext ideal-thickness) - (interval-widen yext ideal-thickness) - ideal-blot)) - (inner (ly:make-stencil (list 'color (x11-color 'white) (ly:stencil-expr (ly:round-filled-box - (cons (+ (car xext) ideal-thickness) (- (cdr xext) ideal-thickness)) - (cons (+ (car yext) ideal-thickness) (- (cdr yext) ideal-thickness)) - (- ideal-blot (* ideal-thickness 2)))))))) + (interval-widen xext ideal-thickness) + (interval-widen yext ideal-thickness) + ideal-blot)) + (inner (ly:make-stencil (list 'color (x11-color 'white) + (ly:stencil-expr (ly:round-filled-box + xext yext (- ideal-blot ideal-thickness))))))) (set! stencil (ly:stencil-add outer inner)) stencil)) -- 2.39.5