diff options
-rw-r--r-- | pict.scm | 28 |
1 files changed, 15 insertions, 13 deletions
@@ -707,19 +707,21 @@ the given COLOR." BORDER-COLOR (a string) and BORDER-WIDTH (a number) are accepted to override the line color and line thickness." (make-pict - `(svg (@ (width ,w) - (height ,h) - (x 0) - (y 0)) - (ellipse (@ (style ,(style-list->string - `(("fill" "none") - ("stroke" ,border-color) - ("stroke-width" - ,(number->string border-width))))) - (cx ,(/ w 2)) - (cy ,(/ h 2)) - (rx ,(/ w 2)) - (ry ,(/ h 2))))))) + (let ((w* (- w border-width)) + (h* (- h border-width))) + `(svg (@ (width ,w) + (height ,h) + (x 0) + (y 0)) + (ellipse (@ (style ,(style-list->string + `(("fill" "none") + ("stroke" ,border-color) + ("stroke-width" + ,(number->string border-width))))) + (cx ,(exact->inexact (+ (/ w* 2) (/ border-width 2)))) + (cy ,(exact->inexact (+ (/ h* 2) (/ border-width 2)))) + (rx ,(exact->inexact (/ w* 2))) + (ry ,(exact->inexact (/ h* 2))))))))) (define* (filled-ellipse w h #:key (color "black")) (remove-outline (fill (ellipse w h) color))) |