fix the use of draw-caret in 2htdp/image

This commit is contained in:
Robby Findler 2011-01-03 20:53:47 -06:00
parent cf344b9926
commit dd9e8c530b

View File

@ -316,7 +316,7 @@ has been moved out).
(define cached-bitmap #f)
(define/override (draw dc x y left top right bottom dx dy draw-caret?)
(define/override (draw dc x y left top right bottom dx dy draw-caret)
(unless cached-bitmap
(set! cached-bitmap (make-bitmap (+ (inexact->exact (round (bb-right bb))) 1)
(+ (inexact->exact (round (bb-bottom bb))) 1)))
@ -326,7 +326,7 @@ has been moved out).
(send bdc set-bitmap #f))
(let ([alpha (send dc get-alpha)])
(when draw-caret?
(when (pair? draw-caret)
(send dc set-alpha (* alpha .5)))
(send dc draw-bitmap cached-bitmap x y)
(send dc set-alpha alpha)))