last bug fixes to hdtch/[i]draw for now
svn: r2763
This commit is contained in:
parent
6376643994
commit
9e23d915ee
|
@ -2,9 +2,6 @@ package draw;
|
||||||
|
|
||||||
public abstract class World {
|
public abstract class World {
|
||||||
protected Canvas theCanvas;
|
protected Canvas theCanvas;
|
||||||
protected void putCanvas(Canvas c) {
|
|
||||||
this.theCanvas = c;
|
|
||||||
};
|
|
||||||
public boolean bigBang(int width, int height, double s) {
|
public boolean bigBang(int width, int height, double s) {
|
||||||
if (width <= 0)
|
if (width <= 0)
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
|
|
|
@ -155,15 +155,17 @@
|
||||||
|
|
||||||
(define (bigBangO-double-native this accs gets privates i)
|
(define (bigBangO-double-native this accs gets privates i)
|
||||||
(define theCanvas ((hash-table-get accs 'theCanvas) this))
|
(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 width (with-method ([g (theCanvas Canvas-width-get)]) (g '___)))
|
||||||
(define height (with-method ([g (theCanvas Canvas-height-get)]) (g '___)))
|
(define height (with-method ([g (theCanvas Canvas-height-get)]) (g '___)))
|
||||||
;; call only *after* start
|
;; call only *after* start
|
||||||
(define (on-event world th)
|
(define (on-event world0 th)
|
||||||
(begin-draw-sequence)
|
(begin-draw-sequence)
|
||||||
(send theCanvas copy)
|
(send theCanvas copy)
|
||||||
(send world erase)
|
(send world0 erase)
|
||||||
(let ([world (imperative (th) world)])
|
(let ([world (imperative (th) world0)])
|
||||||
(send world putCanvas-draw.Canvas theCanvas)
|
(unless (eq? world0 world)
|
||||||
|
(setCanvas world theCanvas))
|
||||||
(send world draw)
|
(send world draw)
|
||||||
(end-draw-sequence)
|
(end-draw-sequence)
|
||||||
world))
|
world))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user