]> git.donarmstrong.com Git - lilypond.git/commitdiff
Gets rid of oval stencil command
authorMike Solomon <mike@apollinemike.com>
Mon, 6 Feb 2012 13:59:47 +0000 (14:59 +0100)
committerMike Solomon <mike@apollinemike.com>
Mon, 6 Feb 2012 13:59:47 +0000 (14:59 +0100)
ps/music-drawing-routines.ps
scm/define-stencil-commands.scm
scm/output-ps.scm
scm/output-svg.scm
scm/stencil.scm

index a06e7b158c724e54f4393e1e142657526bbad8c3..9d2e4070b0b73974d6613a39d92ea08f1ef862c5 100644 (file)
@@ -183,20 +183,6 @@ bind def
        ifelse
 } bind def
 
-/draw_oval % filled? x-radius y-radius thickness draw_ellipse
-{
-  setlinewidth % f? x-r y-r
-  /yrad exch def
-  /xrad exch def
-  xrad 0 rmoveto
-  0 yrad -2 xrad mul dup yrad exch 0 rcurveto
-  0 yrad neg dup 2 xrad mul dup 3 1 roll 0 rcurveto
-  closepath
-      { stroke_and_fill}
-      { stroke }
-  ifelse
-} bind def
-
 /draw_ellipse % filled? x-radius y-radius thickness draw_ellipse
 {
   setlinewidth % f? x-r y-r
index c3a835534d7029318a18e25fe3dcd2f5817901f0..06177cb5126d1f5d16f6cc744a4bbfe34f92e6c8 100644 (file)
@@ -35,7 +35,6 @@ defined in the output modules (@file{output-*.scm})."
     grob-cause
     named-glyph
     no-origin
-    oval
     page-link
     path
     partial-ellipse
index 48b7f7a3f30d2c1c9427aaba9a0531594ada0511..8c8e853567f4851cae95d8a3da82c798813562a6 100644 (file)
 (define (no-origin)
   "")
 
-(define (oval x-radius y-radius thick fill)
-  (ly:format
-   "~a ~4f ~4f ~4f draw_oval"
-   (if fill
-     "true"
-     "false")
-   x-radius y-radius thick))
-
 (define (placebox x y s)
   (if (not (string-null? s))
       (ly:format "~4f ~4f moveto ~a\n" x y s)
index 27b6118483ccdb05cfcb1fce79e805a037637d2f..e3af710b1509a9debcec827ed48f2b4df8ef9028 100644 (file)
 (define (no-origin)
   "")
 
-(define (oval x-radius y-radius thick is-filled)
-  (let ((x-max x-radius)
-       (x-min (- x-radius))
-       (y-max y-radius)
-       (y-min (- y-radius)))
-    (entity
-      'path ""
-      '(stroke-linejoin . "round")
-      '(stroke-linecap . "round")
-      `(fill . ,(if is-filled "currentColor" "none"))
-      `(stroke . "currentColor")
-      `(stroke-width . ,thick)
-      `(d . ,(ly:format "M~4f ~4fC~4f ~4f ~4f ~4f ~4f ~4fS~4f ~4f ~4f ~4fz"
-                       x-max 0
-                       x-max y-max
-                       x-min y-max
-                       x-min 0
-                       x-max y-min
-                       x-max 0)))))
-
 (define* (path thick commands #:optional (cap 'round) (join 'round) (fill? #f))
   (define (convert-path-exps exps)
     (if (pair? exps)
index 1b0cb480c6814e085e48921d683014d2c93c8236..21d7bb86f9924f697df71b92e7d5cc3553ea53cc 100644 (file)
@@ -197,12 +197,20 @@ y@tie{}radius @code{y-radius}, and thickness @var{thickness} with fill
 defined by @code{fill}."
   (let*
       ((x-out-radius (+ x-radius (/ thickness 2.0)))
-       (y-out-radius (+ y-radius (/ thickness 2.0))) )
-
+       (y-out-radius (+ y-radius (/ thickness 2.0)))
+       (x-max x-radius)
+       (x-min (- x-radius))
+       (y-max y-radius)
+       (y-min (- y-radius))
+       (commands `(,(list 'moveto x-max 0)
+                   ,(list 'curveto x-max y-max x-min y-max x-min 0)
+                   ,(list 'curveto x-min y-min x-max y-min x-max 0)
+                   ,(list 'closepath)))
+       (command-list (fold-right append '() commands)))
   (ly:make-stencil
-   (list 'oval x-radius y-radius thickness fill)
-   (cons (- x-out-radius) x-out-radius)
-   (cons (- y-out-radius) y-out-radius))))
+    `(path ,thickness `(,@',command-list) 'round 'round ,fill)
+    (cons (- x-out-radius) x-out-radius)
+    (cons (- y-out-radius) y-out-radius))))
 
 (define-public
   (make-partial-ellipse-stencil
@@ -394,7 +402,6 @@ respectively."
                         (append prepend-origin (list 'closepath))
                         prepend-origin))
         (command-list (fold-right append '() final-path)))
-
   (ly:make-stencil
     `(path ,thickness
           `(,@',command-list)