closes PR 10930

This commit is contained in:
Robby Findler 2010-05-25 17:26:10 -05:00
parent 451961e596
commit bae79dda0b
3 changed files with 9 additions and 5 deletions

View File

@ -103,7 +103,7 @@
(printf "image-gen: didn't find any images; probably this means that you need to delete .zo files and try again\n")] (printf "image-gen: didn't find any images; probably this means that you need to delete .zo files and try again\n")]
[else [else
(printf "\n") (printf "\n")
(call-with-output-file "image-toc.ss" (call-with-output-file "image-toc.rkt"
(λ (port) (λ (port)
(fprintf port "#lang scheme/base\n(provide mapping)\n") (fprintf port "#lang scheme/base\n(provide mapping)\n")
(fprintf port ";; this file is generated by image-gen.ss -- do not edit\n;; note that the file that creates this file depends on this file\n;; it is always safe to simply define (and provide) mapping as the empty list\n\n") (fprintf port ";; this file is generated by image-gen.ss -- do not edit\n;; note that the file that creates this file depends on this file\n;; it is always safe to simply define (and provide) mapping as the empty list\n\n")

View File

@ -10,6 +10,7 @@
(list '(image-baseline (rectangle 100 100 "solid" "black")) 'val 100) (list '(image-baseline (rectangle 100 100 "solid" "black")) 'val 100)
(list '(image-height (text "Hello" 24 "black")) 'val 24) (list '(image-height (text "Hello" 24 "black")) 'val 24)
(list '(image-baseline (text "Hello" 24 "black")) 'val 18) (list '(image-baseline (text "Hello" 24 "black")) 'val 18)
(list '(image-height (rectangle 10 0 "solid" "purple")) 'val 0)
(list (list
'(image-height '(image-height
(overlay (circle 20 "solid" "orange") (circle 30 "solid" "purple"))) (overlay (circle 20 "solid" "orange") (circle 30 "solid" "purple")))
@ -17,6 +18,7 @@
60) 60)
(list '(image-height (circle 30 "solid" "orange")) 'val 60) (list '(image-height (circle 30 "solid" "orange")) 'val 60)
(list '(image-height (ellipse 30 40 "solid" "orange")) 'val 40) (list '(image-height (ellipse 30 40 "solid" "orange")) 'val 40)
(list '(image-width (rectangle 0 10 "solid" "purple")) 'val 0)
(list (list
'(image-width '(image-width
(beside (circle 20 "solid" "orange") (circle 20 "solid" "purple"))) (beside (circle 20 "solid" "orange") (circle 20 "solid" "purple")))

View File

@ -848,22 +848,24 @@ the parts that fit onto @scheme[scene].
@section{Image Properties} @section{Image Properties}
@defproc[(image-width [i image?]) (and/c integer? positive? exact?)]{ @defproc[(image-width [i image?]) (and/c integer? (not/c negative?) exact?)]{
Returns the width of @scheme[i]. Returns the width of @scheme[i].
@image-examples[(image-width (ellipse 30 40 "solid" "orange")) @image-examples[(image-width (ellipse 30 40 "solid" "orange"))
(image-width (circle 30 "solid" "orange")) (image-width (circle 30 "solid" "orange"))
(image-width (beside (circle 20 "solid" "orange") (image-width (beside (circle 20 "solid" "orange")
(circle 20 "solid" "purple")))] (circle 20 "solid" "purple")))
(image-width (rectangle 0 10 "solid" "purple"))]
} }
@defproc[(image-height [i image?]) (and/c integer? positive? exact?)]{ @defproc[(image-height [i image?]) (and/c integer? (not/c negative?) exact?)]{
Returns the height of @scheme[i]. Returns the height of @scheme[i].
@image-examples[(image-height (ellipse 30 40 "solid" "orange")) @image-examples[(image-height (ellipse 30 40 "solid" "orange"))
(image-height (circle 30 "solid" "orange")) (image-height (circle 30 "solid" "orange"))
(image-height (overlay (circle 20 "solid" "orange") (image-height (overlay (circle 20 "solid" "orange")
(circle 30 "solid" "purple")))] (circle 30 "solid" "purple")))
(image-height (rectangle 10 0 "solid" "purple"))]
} }
@defproc[(image-baseline [i image?]) (and/c integer? positive? exact?)]{ @defproc[(image-baseline [i image?]) (and/c integer? positive? exact?)]{