summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2018-04-06 18:18:34 +0200
committerRicardo Wurmus <rekado@elephly.net>2018-04-06 18:18:34 +0200
commitb033d698ed53d5fac2865c73cf79f08d4dd3cf7a (patch)
treebe2ff8e40e1ee7fd51b201bd0e35d501fc6b48d4
parente5df409e75b942ba89e4c9dfc4a8ab2a7877ebd9 (diff)
Limit circle border width.
-rw-r--r--pict.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/pict.scm b/pict.scm
index 5a5b9b1..36f61c9 100644
--- a/pict.scm
+++ b/pict.scm
@@ -531,7 +531,9 @@ strings that are built from the list of attributes LST."
#:key
(border-color "black")
(border-width 1))
- (let ((radius (- (/ size 2) border-width)))
+ (let* ((border-width (min border-width (/ size 2)))
+ (radius (exact->inexact
+ (/ (- size border-width) 2))))
(make-pict
`(svg (@ (width ,size)
(height ,size)
@@ -542,8 +544,8 @@ strings that are built from the list of attributes LST."
("stroke" ,border-color)
("stroke-width"
,(number->string border-width)))))
- (cx ,(+ radius border-width))
- (cy ,(+ radius border-width))
+ (cx ,(+ radius (/ border-width 2)))
+ (cy ,(+ radius (/ border-width 2)))
(r ,radius)))))))
(define* (disk size