summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pict.scm31
1 files changed, 16 insertions, 15 deletions
diff --git a/pict.scm b/pict.scm
index 27f8fdd..4e30f6b 100644
--- a/pict.scm
+++ b/pict.scm
@@ -737,21 +737,22 @@ BORDER-COLOR (a string) and BORDER-WIDTH (a number) are accepted to
override the line color and line thickness, respectively. The keys RX
and RY can be provided to round off the corners."
(make-pict
- `(svg (@ (width ,w)
- (height ,h)
- (x 0)
- (y 0))
- (rect (@ (style ,(style-list->string
- `(("fill" "none")
- ("stroke" ,border-color)
- ("stroke-width"
- ,(number->string border-width)))))
- (x 0)
- (y 0)
- (width ,w)
- (height ,h)
- (rx ,rx)
- (ry ,ry))))))
+ (let ((half-line-width (exact->inexact (/ border-width 2))))
+ `(svg (@ (width ,w)
+ (height ,h)
+ (x 0)
+ (y 0))
+ (rect (@ (style ,(style-list->string
+ `(("fill" "none")
+ ("stroke" ,border-color)
+ ("stroke-width"
+ ,(number->string border-width)))))
+ (x ,half-line-width)
+ (y ,half-line-width)
+ (width ,(- w border-width))
+ (height ,(- h border-width))
+ (rx ,rx)
+ (ry ,ry)))))))
(define* (filled-rectangle w h #:key
(color "black")