fix draw-polygon' on pairs instead of point%'s

Closes PR 12455
This commit is contained in:
Matthew Flatt 2011-12-23 07:25:59 -06:00
parent 5cd324af15
commit 5bfaea25fe
2 changed files with 9 additions and 6 deletions

View File

@ -24,7 +24,9 @@
(define black (send the-color-database find-color "black"))
(define (clone-point p)
(make-object point% (point-x p) (point-y p)))
(if (pair? p)
p
(make-object point% (point-x p) (point-y p))))
(define (clone-color c)
(if (string? c)

View File

@ -65,11 +65,12 @@
(send f show #t)))
(define star
(list (make-object point% 30 0)
(make-object point% 48 60)
(make-object point% 0 20)
(make-object point% 60 20)
(make-object point% 12 60)))
;; uses pairs instead of point%s
(list (cons 30 0)
(cons 48 60)
(cons 0 20)
(cons 60 20)
(cons 12 60)))
(define octagon
(list (make-object point% 60 60)