]> git.donarmstrong.com Git - lilypond.git/commitdiff
\rounded-box, final take
authorValentin Villenave <valentin@villenave.net>
Mon, 21 Apr 2008 18:05:33 +0000 (20:05 +0200)
committerValentin Villenave <valentin@villenave.net>
Mon, 21 Apr 2008 18:05:33 +0000 (20:05 +0200)
Small corrections (backslashes escaping,
corner-radius property implementation,
and correction of default thickness)

scm/define-grob-properties.scm
scm/define-markup-commands.scm
scm/stencil.scm

index 3fb91c199e76d461901b443133095ea102f8c738..c767e09a71868cde81b18b979b2fece8b0a977e5 100644 (file)
@@ -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
index e5d7196cd1cbfe90cfb369b3fd57ae22e314053d..3ec32d7335bba9e7c0bce9dfdef6ec89371cae3b 100644 (file)
@@ -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 (*
index 3256d49f61e6140b229cf0d721548d0966348648..536425b9c680ce5a44b0c7bcbe9f8924d94142fd 100644 (file)
@@ -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))