fixed immediate world and graphing bugs

svn: r4637
This commit is contained in:
Matthias Felleisen 2006-10-19 01:58:06 +00:00
parent d4b06ad3f5
commit c7a8c49ac8
2 changed files with 8 additions and 6 deletions

View File

@ -23,10 +23,12 @@
;; between [0,10] and [0,10] on x/y axis
(define (make-graph name)
(start EAST SOUTH)
(draw-solid-line ORIGIN X-AXIS 'blue)
((draw-string #cs(get-@VP)) (make-posn (+ OFFSET 10) (+ OFFSET 10)) "Y-AXIS")
(draw-solid-line ORIGIN Y-AXIS 'blue)
((draw-string #cs(get-@VP)) (make-posn (- EAST 100) (- SOUTH 15)) "X-AXIS"))
(let* ([vp+pm #cs(get-@VP)]
[vp (car vp+pm)])
(draw-solid-line ORIGIN X-AXIS 'blue)
((draw-string vp) (make-posn (+ OFFSET 10) (+ OFFSET 10)) "Y-AXIS")
(draw-solid-line ORIGIN Y-AXIS 'blue)
((draw-string vp) (make-posn (- EAST 100) (- SOUTH 15)) "X-AXIS")))
;; (num -> num) symbol -> true
;; effect: draw function graph for x in [0,10] at delta = .1

View File

@ -271,8 +271,8 @@
(with-handlers ([exn:break? break-handler]
[exn? exn-handler])
(set! the-world (f the-world
(send e get-x)
(send e get-y)
(- (send e get-x) INSET)
(- (send e get-y) INSET)
(cond [(send e button-down?) 'button-down]
[(send e button-up?) 'button-up]
[(send e dragging?) 'drag]