fixed bug in image library

svn: r4230
This commit is contained in:
Robby Findler 2006-09-03 04:03:06 +00:00
parent 79d3315ab7
commit bc388368a7
2 changed files with 16 additions and 7 deletions

View File

@ -222,10 +222,10 @@ plt/collects/tests/mzscheme/image-test.ss
[bottom (max (+ delta-y b-h) a-h)]
[new-w (inexact->exact (ceiling (- right left)))]
[new-h (inexact->exact (ceiling (- bottom top)))]
[a-dx (- left)]
[a-dy (- top)]
[b-dx (- delta-x left)]
[b-dy (- delta-y top)]
[a-dx (inexact->exact (round (- left)))]
[a-dy (inexact->exact (round (- top)))]
[b-dx (inexact->exact (round (- delta-x left)))]
[b-dy (inexact->exact (round (- delta-y top)))]
[new-px (- a-px left)]
[new-py (- a-py top)]
[combine (lambda (a-f b-f)

View File

@ -147,7 +147,9 @@
void
(lambda (x) #f))])
(if data
(argb->cache-image-snip (make-argb (first data) (second data)) (third data) (fourth data))
(argb->cache-image-snip (make-argb (first data) (second data))
(third data)
(fourth data))
(make-null-cache-image-snip))))
(super-new)))
@ -634,9 +636,16 @@ for b3, we have:
(* -255 m3))
(- 255 m3))))
(define bitmap-size/c (and/c integer? exact? (between/c 1 10000)))
(provide/contract
[overlay-bitmap (argb? number? number? (is-a?/c bitmap%) (is-a?/c bitmap%) . -> . any)]
[build-bitmap (((is-a?/c dc<%>) . -> . any) number? number? . -> . (is-a?/c bitmap%))]
[overlay-bitmap (argb? (and/c integer? exact?)
(and/c integer? exact?)
(is-a?/c bitmap%)
(is-a?/c bitmap%)
. -> .
any)]
[build-bitmap (((is-a?/c dc<%>) . -> . any) bitmap-size/c bitmap-size/c . -> . (is-a?/c bitmap%))]
[flatten-bitmap ((is-a?/c bitmap%) . -> . (is-a?/c bitmap%))]
[argb->cache-image-snip (argb? number? number? . -> . (is-a?/c cache-image-snip%))]