fix PS/PDF size

since a PS/PDF bounding box is an integer, take the ceiling
 of a requested width & height
This commit is contained in:
Matthew Flatt 2011-03-27 16:06:41 -06:00
parent 4021f55c61
commit 67b7c8f3f4
2 changed files with 11 additions and 7 deletions

View File

@ -70,12 +70,14 @@
(not fn)) (not fn))
(values #f #f #f #f #f #f #f) (values #f #f #f #f #f #f #f)
(let* ([paper (assoc (send pss get-paper-name) paper-sizes)] (let* ([paper (assoc (send pss get-paper-name) paper-sizes)]
[w (if (or (not init-w) use-paper-bbox) [w (ceiling
(cadr paper) (if (or (not init-w) use-paper-bbox)
init-w)] (cadr paper)
[h (if (or (not init-h) use-paper-bbox) init-w))]
(caddr paper) [h (ceiling
init-h)] (if (or (not init-h) use-paper-bbox)
(caddr paper)
init-h))]
[landscape? (eq? (send pss get-orientation) 'landscape)] [landscape? (eq? (send pss get-orientation) 'landscape)]
[file (if (output-port? fn) [file (if (output-port? fn)
fn fn
@ -182,6 +184,7 @@
(define/override (can-mask-bitmap?) (define/override (can-mask-bitmap?)
#f) #f)
(define/override (dc-adjust-cap-shape shape sx pw) shape)
(define/override (get-hairline-width cx) (/ 1.0 (* cx 4))) (define/override (get-hairline-width cx) (/ 1.0 (* cx 4)))
(define is-eps? (and as-eps #t)) (define is-eps? (and as-eps #t))

View File

@ -39,7 +39,8 @@ If @scheme[interactive] is @scheme[#f], then the settings returned by
If @scheme[use-paper-bbox] is @scheme[#f], then the PostScript If @scheme[use-paper-bbox] is @scheme[#f], then the PostScript
bounding box for the output is determined by @racket[width] and bounding box for the output is determined by @racket[width] and
@racket[height]. If @scheme[use-paper-bbox] is not @scheme[#f], then @racket[height] (which are rounded upward using @racket[ceiling]).
If @scheme[use-paper-bbox] is not @scheme[#f], then
the bounding box is determined by the current paper size (as the bounding box is determined by the current paper size (as
specified by @scheme[current-ps-setup]). When @racket[width] or specified by @scheme[current-ps-setup]). When @racket[width] or
@racket[height] is @racket[#f], then the corresponding dimension is @racket[height] is @racket[#f], then the corresponding dimension is