summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pict.scm28
1 files changed, 15 insertions, 13 deletions
diff --git a/pict.scm b/pict.scm
index e1a6f82..27f8fdd 100644
--- a/pict.scm
+++ b/pict.scm
@@ -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)))