From edae15d25483626e8e5bb86600f1863e3fc778a8 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 8 Feb 2020 09:36:19 -0800 Subject: [PATCH] refine the line --- quad/quadwriter/attrs.rkt | 11 +++++------ quad/quadwriter/layout.rkt | 9 ++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/quad/quadwriter/attrs.rkt b/quad/quadwriter/attrs.rkt index ffedd38f..38eac04c 100644 --- a/quad/quadwriter/attrs.rkt +++ b/quad/quadwriter/attrs.rkt @@ -101,11 +101,10 @@ Naming guidelines height position text + color x y - x1 x2 - y1 y2)) @@ -219,16 +218,16 @@ Naming guidelines :line-height :x :y - :x1 :x2 - :y1 - :y2)) #true)) + :y2 + :width)) #true)) (define (has-case-sensitive-value? k) (and (memq k (list :pdf-title :pdf-subject :pdf-author - :pdf-keywords)) #true)) + :pdf-keywords + :text)) #true)) (define (takes-path? k) (and (memq k (list :image-file)) #true)) diff --git a/quad/quadwriter/layout.rkt b/quad/quadwriter/layout.rkt index f6edc503..437ffde8 100644 --- a/quad/quadwriter/layout.rkt +++ b/quad/quadwriter/layout.rkt @@ -166,9 +166,12 @@ (quad-origin q))) (match (quad-ref q :draw) ["line" - (move-to doc (quad-ref q :x1 0) (quad-ref q :y1 0)) - (line-to doc (quad-ref q :x2 0) (quad-ref q :y2 0)) - (stroke doc "black")] + (define x0 (quad-ref q :x 0)) + (define y0 (quad-ref q :y 0)) + (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) (q:string-draw q doc #:origin (pt (quad-ref q :x 0) (quad-ref q :y 0))