notes
This commit is contained in:
parent
0c09efe7fb
commit
3455194328
22
draw.rkt
22
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))
|
||||
|
|
15
size.rkt
15
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))))
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue