Add sample for #76.

This commit is contained in:
Corey O'Connor 2015-08-08 17:27:14 -07:00
parent 20eb987e2b
commit 7617f21877
4 changed files with 19 additions and 1 deletions

View File

@ -184,7 +184,8 @@ pad inL inT inR inB inImage
where w = imageWidth i + l
h = imageHeight i
-- | translates an image by padding or cropping the top and left.
-- | translates an image by padding or cropping the left and top. First param is amount to translate
-- left. Second param is amount to translate top.
--
-- This can have an unexpected effect: Translating an image to less than (0,0) then to greater than
-- (0,0) will crop the image.

17
test/Issue76.hs Normal file
View File

@ -0,0 +1,17 @@
module Main where
import Control.Monad (void)
import Graphics.Vty
main :: IO ()
main = do
cfg <- standardIOConfig
vty <- mkVty cfg
let line1 = charFill (defAttr `withBackColor` blue) ' ' 10 1
line2 = charFill (defAttr `withBackColor` green) ' ' 10 1
img = translate 10 5 (line1 `vertJoin` line2)
pic = picForImage img
update vty pic
void $ nextEvent vty
shutdown vty