From 8360fbfba05a6be082c742575a2550771b4755dc Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Thu, 20 Mar 2008 21:20:38 +0000 Subject: [PATCH] fixed bug in place-image0 svn: r9032 --- collects/htdp/world.ss | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/collects/htdp/world.ss b/collects/htdp/world.ss index d4b79ffe27..af0572a088 100644 --- a/collects/htdp/world.ss +++ b/collects/htdp/world.ss @@ -23,6 +23,7 @@ ones.) Matthew |# +;; Thu Mar 20 17:15:54 EDT 2008: fixed place-image0, which used shrink off-by-1 ;; Mon Sep 17 09:40:39 EDT 2007: run-simulation now allows recordings, too ;; Mon Aug 6 19:50:30 EDT 2007: exporting both add-line from image.ss and scene+line ;; Fri May 4 18:05:33 EDT 2007: define-run-time-path @@ -391,6 +392,7 @@ Matthew ; ;; Image Number Number Image -> Image + #; (define (place-image0 image x y scene) (define sw (image-width scene)) (define sh (image-height scene)) @@ -399,6 +401,14 @@ Matthew (define nh (image-height ns)) (if (and (= sw nw) (= sh nh)) ns (shrink ns 0 0 sw sh))) + (define (place-image0 image x y scene) + (define sw (image-width scene)) + (define sh (image-height scene)) + (define ns (overlay/xy scene x y image)) + (define nw (image-width ns)) + (define nh (image-height ns)) + (if (and (= sw nw) (= sh nh)) ns (shrink ns 0 0 (- sw 1) (- sh 1)))) + ;; Image Number Number Number Number Color -> Image (define (add-line-to-scene0 img x0 y0 x1 y1 c) (define w (image-width img))