Skip to content

Commit 67f215e

Browse files
committed
fix contract on disk
(bug found by random testing)
1 parent 3f5ca73 commit 67f215e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pkgs/pict-pkgs/pict-doc/pict/scribblings/pict.scrbl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ override settings supplied by the context.
288288
@defproc*[([(ellipse [w real?] [h real?]) pict?]
289289
[(circle [diameter real?]) pict?]
290290
[(filled-ellipse [w real?] [h real?] [#:draw-border? draw-border? any/c #t]) pict?]
291-
[(disk [diameter real?] [#:draw-border? draw-border? any/c #t]) pict?])]{
291+
[(disk [diameter (and/c rational? (not/c negative?))]
292+
[#:draw-border? draw-border? any/c #t]) pict?])]{
292293

293294
Unfilled and filled ellipses.
294295

pkgs/pict-pkgs/pict-lib/pict/main.rkt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
pict->argb-pixels
1010
argb-pixels->pict
1111
colorize
12-
pin-under pin-over)
12+
pin-under pin-over disk)
1313
(contract-out
1414
[colorize (-> pict?
1515
(or/c string?
@@ -43,7 +43,8 @@
4343
real?
4444
(-> pict? pict? (values real? real?)))]
4545
[pict pict?])
46-
[result pict?])]))
46+
[result pict?])]
47+
[disk (->* ((and/c rational? (not/c negative?))) (#:draw-border? any/c) pict?)]))
4748

4849
(define (multiple-of-four-bytes? b)
4950
(zero? (modulo (bytes-length b) 4)))

0 commit comments

Comments
 (0)