diff --git a/draw.rkt b/draw.rkt index 3d1c86d..10d59f3 100644 --- a/draw.rkt +++ b/draw.rkt @@ -157,14 +157,16 @@ (error 'matte "Original (~ax~a) must fit inside matte (~ax~a)" xw xh w h)) (matte-at w h - (match ws - ['left 0] - ['center (floor (/ (- w xw) 2))] - ['right (- w xw)]) - (match hs - ['top 0] - ['center (floor (/ (- h xh) 2))] - ['bottom (- h xh)]) + (max 1 + (match ws + ['left 0] + ['center (floor (/ (- w xw) 2))] + ['right (- w xw)])) + (max 1 + (match hs + ['top 0] + ['center (floor (/ (- h xh) 2))] + ['bottom (- h xh)])) x)) (define (inset dw dh x) @@ -269,10 +271,6 @@ (for/list ([col (in-list row)]) (if (raart? col) col (text (~a col)))))) -;; xxx render xexpr-like thing -;; xxx text... (fit text inside a width) -;; xxx paragraph (fit text inside a box) - (define style/c (apply or/c (hash-keys symbol->style))) (define color/c (apply or/c (hash-keys symbol->color))) (define valign/c (or/c 'top 'center 'bottom)) diff --git a/size.rkt b/size.rkt index 49ef035..7e8774d 100644 --- a/size.rkt +++ b/size.rkt @@ -77,9 +77,22 @@ (bytes->number col-s))] [x (error 'cursor-position "Something weird happened, got ~e" x)])))) +;; xxx xterm-set-window-title + +;; xxx Do I make a 'lux chaos' for this? +;; +;; Or do I do the rune thing and make a separation between the +;; commands and the keys? Also, how should the mouse events fit +;; into that? + +;; xxx render xexpr-like thing +;; xxx text... (fit text inside a width) +;; xxx paragraph (fit text inside a box) + +;; xxx make a "Web" browser + (module+ main (with-term (λ (t) (screen-size t) (cursor-position t)))) - diff --git a/t/draw.rkt b/t/draw.rkt index 0d068d3..ababfde 100644 --- a/t/draw.rkt +++ b/t/draw.rkt @@ -2,7 +2,8 @@ (require raart) (module+ test - (draw (crop 70 80 10 20 + (draw (crop 1 80 1 20 + ;;70 80 10 20 (matte 80 20 #:halign 'right (fg 'blue @@ -14,6 +15,7 @@ (style 'bold (text "Right"))))))))) (newline)) +#; (module+ test (draw (translate 2 10