restrict numerical precision

main
Matthew Butterick 8 years ago
parent 1b4968d107
commit 1034576bfe

@ -42,7 +42,8 @@
(public [@bezierCurveTo bezierCurveTo])
(define (@bezierCurveTo cp1x cp1y cp2x cp2y x y)
(send this addContent (format "~a ~a ~a ~a ~a ~a c" cp1x cp1y cp2x cp2y x y)))
(send this addContent (format "~a c"
(string-join (map number (list cp1x cp1y cp2x cp2y x y)) " "))))
(public [@ellipse ellipse])
@ -115,7 +116,7 @@
[(list (? number? xFactor)) (@scale xFactor (mhash))]
[(list (? number? xFactor) (? hash? options)) (@scale xFactor xFactor options)]
[(list (? number? xFactor) (? number? yFactor)) (@scale xFactor yFactor (mhash))]
[(list (? number? xFactor) (? number? yFactor) (? hash? options))
[(list (? number? xFactor) (? number? yFactor) (? hash? options))
(define x 0) (define y 0)
(when (hash-ref options 'origin #f)
(match-define (list x y) (hash-ref options 'origin))

@ -16,7 +16,7 @@ endobj
endobj
3 0 obj
<<
/Length 344
/Length 280
>>
stream
1 0 0 -1 0 792 cm
@ -29,10 +29,10 @@ q
f
230 200 m
230 172.38576250846032 252.38576250846032 150 280 150 c
307.61423749153965 150 330 172.38576250846032 330 200 c
330 227.61423749153968 307.61423749153965 250 280 250 c
252.38576250846032 250 230 227.61423749153968 230 200 c
230 172.385763 252.385763 150 280 150 c
307.614237 150 330 172.385763 330 200 c
330 227.614237 307.614237 250 280 250 c
252.385763 250 230 227.614237 230 200 c
h
/DeviceRGB cs
0.4 0 1 scn
@ -64,12 +64,12 @@ endobj
xref
0 7
0000000000 65535 f
0000000730 00000 n
0000000681 00000 n
0000000666 00000 n
0000000617 00000 n
0000000186 00000 n
0000000119 00000 n
0000000015 00000 n
0000000581 00000 n
0000000517 00000 n
trailer
<<
/Info 6 0 R
@ -77,5 +77,5 @@ trailer
/Size 7
>>
startxref
787
723
%%EOF

Loading…
Cancel
Save