avoid `on-size' problems

Merge to 5.1
(cherry picked from commit e2c43bf3ec)
This commit is contained in:
Matthew Flatt 2011-01-30 15:39:40 -06:00 committed by Eli Barzilay
parent 7c51edfe76
commit 60cc50a54b

View File

@ -206,8 +206,8 @@
(set! old-h h)
(as-exit (lambda () (send mred on-size w h)))))
(let* ([p (area-parent)]
[x (- (get-x) (or (and p (send p dx)) 0))]
[y (- (get-y) (or (and p (send p dy)) 0))])
[x (max -10000 (min 10000 (- (get-x) (or (and p (send p dx)) 0))))]
[y (max -10000 (min 10000 (- (get-y) (or (and p (send p dy)) 0))))])
(when (not (and (= x old-x) (= y old-y)))
(set! old-x x)
(set! old-y y)