fix bug in the computation to determine if the big interactions/definitions

label and the region to be refreshed have some overlap
This commit is contained in:
Robby Findler 2012-07-26 18:40:12 -05:00
parent 203fbf7950
commit af3d52f9b5

View File

@ -1804,10 +1804,9 @@
(define-values (tw th _1 _2) (send dc get-text-extent id)) (define-values (tw th _1 _2) (send dc get-text-extent id))
(define tx (+ (unbox bx) (- (unbox bw) tw))) (define tx (+ (unbox bx) (- (unbox bw) tw)))
(define ty (+ (unbox by) (- (unbox bh) th))) (define ty (+ (unbox by) (- (unbox bh) th)))
(when (and (or (< left tx right) (when (rectangles-intersect?
(< left (+ tx tw) right)) left top right bottom
(or (< top ty bottom) tx ty (+ tx tw) (+ ty th))
(< top (+ ty th) bottom)))
(send dc set-text-foreground "black") (send dc set-text-foreground "black")
(send dc set-alpha .5) (send dc set-alpha .5)
(send dc draw-text id (+ dx tx) (+ dy ty)) (send dc draw-text id (+ dx tx) (+ dy ty))
@ -1816,13 +1815,22 @@
(send dc set-font defs/ints-font))))) (send dc set-font defs/ints-font)))))
(super-new))) (super-new)))
(define (rectangles-intersect? l1 t1 r1 b1 l2 t2 r2 b2)
(or (point-in-rectangle? l1 t1 l2 t2 r2 b2)
(point-in-rectangle? r1 t1 l2 t2 r2 b2)
(point-in-rectangle? l1 b1 l2 t2 r2 b2)
(point-in-rectangle? r1 b1 l2 t2 r2 b2)))
(define (point-in-rectangle? x y l t r b)
(and (<= l x r)
(<= t y b)))
(define bx (box 0)) (define bx (box 0))
(define by (box 0)) (define by (box 0))
(define bw (box 0)) (define bw (box 0))
(define bh (box 0)) (define bh (box 0))
(define module-language-interactions-text-mixin (define module-language-interactions-text-mixin
(mk-module-language-text-mixin (string-constant interactions-window-label))) (mk-module-language-text-mixin (string-constant interactions-window-label)))
(define module-language-definitions-text-mixin (define module-language-definitions-text-mixin