From: Mike Solomon Date: Mon, 6 Feb 2012 13:59:47 +0000 (+0100) Subject: Gets rid of oval stencil command X-Git-Tag: release/2.15.29-1~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b231459a563c15e11b426c72192d15c49be156b4;p=lilypond.git Gets rid of oval stencil command --- diff --git a/ps/music-drawing-routines.ps b/ps/music-drawing-routines.ps index a06e7b158c..9d2e4070b0 100644 --- a/ps/music-drawing-routines.ps +++ b/ps/music-drawing-routines.ps @@ -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 diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm index c3a835534d..06177cb512 100644 --- a/scm/define-stencil-commands.scm +++ b/scm/define-stencil-commands.scm @@ -35,7 +35,6 @@ defined in the output modules (@file{output-*.scm})." grob-cause named-glyph no-origin - oval page-link path partial-ellipse diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 48b7f7a3f3..8c8e853567 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -195,14 +195,6 @@ (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) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 27b6118483..e3af710b15 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -503,26 +503,6 @@ (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) diff --git a/scm/stencil.scm b/scm/stencil.scm index 1b0cb480c6..21d7bb86f9 100644 --- a/scm/stencil.scm +++ b/scm/stencil.scm @@ -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)