From fa76b65de716ae858ecd48de1dfeb31433caa48b Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Fri, 11 Jan 2019 13:10:45 -0800 Subject: [PATCH] better offset idea --- quad/qtest/hyphenate.rkt | 2 +- quad/qtest/markdown.rkt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/quad/qtest/hyphenate.rkt b/quad/qtest/hyphenate.rkt index 6b31e1aa..69bb71a1 100644 --- a/quad/qtest/hyphenate.rkt +++ b/quad/qtest/hyphenate.rkt @@ -2,7 +2,7 @@ # Hyphenate -A **simple** _hyphenation engine_ that uses the Knuth–Liang hyphenation algorithm originally developed for TeX. +A simple _hyphenation engine_ that uses the Knuth–Liang hyphenation algorithm originally developed for TeX. I **have added little** to their work. Accordingly, I take no credit, except a spoonful of *snako-bits.* diff --git a/quad/qtest/markdown.rkt b/quad/qtest/markdown.rkt index 55f31b09..71310a35 100644 --- a/quad/qtest/markdown.rkt +++ b/quad/qtest/markdown.rkt @@ -108,7 +108,6 @@ #:in 'nw #:inner 'sw ; puts baseline at lower right corner of line box #:out 'sw - #:offset (pt 4 -6) #:printable #true #:draw (λ (q doc) (draw-debug q doc) @@ -199,7 +198,9 @@ (pt-y (size pc))))) #:pre-draw (λ (q doc) (save doc) - (apply rect doc (append (quad-origin q) (size q))) + (match-define (list left top) (quad-origin q)) + (match-define (list right bottom) (size q)) + (rect doc (- left 4) (+ top 6) right (+ bottom 2)) (line-width doc 1) (fill-and-stroke doc "#eee" "#999") (restore doc))))