cache bitmap and dc for snip sizing
svn: r4708
This commit is contained in:
parent
97a56ca84c
commit
b61846baba
|
@ -11,15 +11,17 @@
|
|||
(define (image? a)
|
||||
(or (is-a? a image-snip%)
|
||||
(is-a? a cache-image-snip%)))
|
||||
|
||||
(define size-dc (delay (make-object bitmap-dc% (make-object bitmap% 1 1))))
|
||||
|
||||
(define (snip-size a)
|
||||
(cond
|
||||
[(is-a? a cache-image-snip%)
|
||||
(send a get-size)]
|
||||
[else
|
||||
(let ([dc (make-object bitmap-dc% (make-object bitmap% 1 1))]
|
||||
[wb (box 0)]
|
||||
[hb (box 0)])
|
||||
(let* ([dc (force size-dc)]
|
||||
[wb (box 0)]
|
||||
[hb (box 0)])
|
||||
(send a get-extent dc 0 0 wb hb #f #f #f #f)
|
||||
(values (unbox wb)
|
||||
(unbox hb)))]))
|
||||
|
|
|
@ -28,16 +28,16 @@
|
|||
(syntax args))
|
||||
stx)]
|
||||
[id
|
||||
(syntax-property
|
||||
(datum->syntax-object
|
||||
check-proc
|
||||
(list check-proc
|
||||
(list 'quote (syntax id))
|
||||
tmp-id)
|
||||
stx)
|
||||
(syntax-property
|
||||
(datum->syntax-object
|
||||
check-proc
|
||||
(list check-proc
|
||||
(list 'quote (syntax id))
|
||||
tmp-id)
|
||||
stx)
|
||||
'stepper-skipto
|
||||
'(syntax-e cdr syntax-e cdr cdr car))]))))) ; this may make other stepper-skipto annotations obsolete.
|
||||
|
||||
|
||||
(define (appropriate-use what)
|
||||
(case what
|
||||
[(constructor)
|
||||
|
|
Loading…
Reference in New Issue
Block a user