From 9e23d915ee00b49492c1e5fa6f0ea4f85824452e Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Mon, 24 Apr 2006 15:29:45 +0000 Subject: [PATCH] last bug fixes to hdtch/[i]draw for now svn: r2763 --- collects/htdch/draw/World.java | 3 --- collects/htdch/draw/support.scm | 10 ++++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/collects/htdch/draw/World.java b/collects/htdch/draw/World.java index f2e97ba1b4..4dd7575daf 100644 --- a/collects/htdch/draw/World.java +++ b/collects/htdch/draw/World.java @@ -2,9 +2,6 @@ package draw; public abstract class World { protected Canvas theCanvas; - protected void putCanvas(Canvas c) { - this.theCanvas = c; - }; public boolean bigBang(int width, int height, double s) { if (width <= 0) throw new RuntimeException( diff --git a/collects/htdch/draw/support.scm b/collects/htdch/draw/support.scm index 2d49103b3c..7b71d1a955 100644 --- a/collects/htdch/draw/support.scm +++ b/collects/htdch/draw/support.scm @@ -155,15 +155,17 @@ (define (bigBangO-double-native this accs gets privates i) (define theCanvas ((hash-table-get accs 'theCanvas) this)) + (define setCanvas (hash-table-get gets 'theCanvas)) (define width (with-method ([g (theCanvas Canvas-width-get)]) (g '___))) (define height (with-method ([g (theCanvas Canvas-height-get)]) (g '___))) ;; call only *after* start - (define (on-event world th) + (define (on-event world0 th) (begin-draw-sequence) (send theCanvas copy) - (send world erase) - (let ([world (imperative (th) world)]) - (send world putCanvas-draw.Canvas theCanvas) + (send world0 erase) + (let ([world (imperative (th) world0)]) + (unless (eq? world0 world) + (setCanvas world theCanvas)) (send world draw) (end-draw-sequence) world))