refine the line

main
Matthew Butterick 4 years ago
parent 2598b83277
commit edae15d254

@ -101,11 +101,10 @@ Naming guidelines
height height
position position
text text
color
x x
y y
x1
x2 x2
y1
y2)) y2))
@ -219,16 +218,16 @@ Naming guidelines
:line-height :line-height
:x :x
:y :y
:x1
:x2 :x2
:y1 :y2
:y2)) #true)) :width)) #true))
(define (has-case-sensitive-value? k) (define (has-case-sensitive-value? k)
(and (memq k (list :pdf-title (and (memq k (list :pdf-title
:pdf-subject :pdf-subject
:pdf-author :pdf-author
:pdf-keywords)) #true)) :pdf-keywords
:text)) #true))
(define (takes-path? k) (define (takes-path? k)
(and (memq k (list :image-file)) #true)) (and (memq k (list :image-file)) #true))

@ -166,9 +166,12 @@
(quad-origin q))) (quad-origin q)))
(match (quad-ref q :draw) (match (quad-ref q :draw)
["line" ["line"
(move-to doc (quad-ref q :x1 0) (quad-ref q :y1 0)) (define x0 (quad-ref q :x 0))
(line-to doc (quad-ref q :x2 0) (quad-ref q :y2 0)) (define y0 (quad-ref q :y 0))
(stroke doc "black")] (move-to doc x0 y0)
(line-to doc (quad-ref q :x2 x0) (quad-ref q :y2 y0))
(line-width doc (quad-ref q :width 1))
(stroke doc (quad-ref q :color "black"))]
["text" (move-to doc 0 0) ["text" (move-to doc 0 0)
(q:string-draw q doc (q:string-draw q doc
#:origin (pt (quad-ref q :x 0) (quad-ref q :y 0)) #:origin (pt (quad-ref q :x 0) (quad-ref q :y 0))

Loading…
Cancel
Save