From 693ba9b9e842833740bb456d31a8a72a577d3a8a Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 5 Nov 2009 14:55:07 +0000 Subject: [PATCH] allow overlaying of 0x0 images svn: r16558 --- collects/htdp/image.ss | 3 ++- collects/tests/mzscheme/htdp-image.ss | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/collects/htdp/image.ss b/collects/htdp/image.ss index 36b3a6f71a..2f5b66c5e8 100644 --- a/collects/htdp/image.ss +++ b/collects/htdp/image.ss @@ -247,7 +247,8 @@ plt/collects/tests/mzscheme/htdp-image.ss (lambda (dc dx dy) (a-f dc (+ dx a-dx) (+ dy a-dy)) (b-f dc (+ dx b-dx) (+ dy b-dy))))]) - (check-sizes name new-w new-h) + (unless (and (<= 0 new-w 10000) (<= 0 new-h 10000)) + (error name (format "cannot make ~a x ~a image" new-w new-h))) (new cache-image-snip% [dc-proc (combine (send a get-dc-proc) (send b get-dc-proc))] diff --git a/collects/tests/mzscheme/htdp-image.ss b/collects/tests/mzscheme/htdp-image.ss index e5fb94b5db..45dd5a6525 100644 --- a/collects/tests/mzscheme/htdp-image.ss +++ b/collects/tests/mzscheme/htdp-image.ss @@ -996,6 +996,8 @@ (test '() image->alpha-color-list (rectangle 10 0 'solid 'red)) (test '() image->alpha-color-list (rectangle 0 0 'solid 'red)) +(test 0 image-width (overlay (circle 0 'solid 'red) (circle 0 'solid 'red))) +(test 0 image-height (overlay (circle 0 'solid 'red) (circle 0 'solid 'red))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;