mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-11-26 09:06:56 +03:00
Support embedding raw images in Prim
This commit is contained in:
parent
ebc5c80a79
commit
6c3c43e9fe
@ -38,11 +38,15 @@ data Prim = Fixed String
|
||||
| HLimit Int Prim
|
||||
| VLimit Int Prim
|
||||
| UseAttr Attr Prim
|
||||
| Raw Image
|
||||
|
||||
mkImage :: DisplayRegion -> Attr -> Prim -> Image
|
||||
mkImage (w, h) a (Fixed s) = if w > 0 && h > 0
|
||||
then crop w h $ string a s
|
||||
else emptyImage
|
||||
mkImage (w, h) _ (Raw img) = if w > 0 && h > 0
|
||||
then crop w h img
|
||||
else emptyImage
|
||||
mkImage (w, _) a (HFill c) = charFill a c w 1
|
||||
mkImage (_, h) a (VFill c) = charFill a c 1 h
|
||||
mkImage (_, h) a (HLimit w p) = mkImage (w, h) a p
|
||||
|
Loading…
Reference in New Issue
Block a user