Add sample for #76.
commit7617f218773d5b91bda193959d2f7143740d114b
authorCorey O'Connor <coreyoconnor@gmail.com>
dateSat 8 Aug 2015, 17:27 (11 years ago)
parent20eb987
src/Graphics/Vty/Image.hs+2−1
@@ -184,7 +184,8 @@ pad inL inT inR inB inImage
184184 where w = imageWidth i + l
185185 h = imageHeight i
186186
187−-- | translates an image by padding or cropping the top and left.
187+-- | translates an image by padding or cropping the left and top. First param is amount to translate
188+-- left. Second param is amount to translate top.
188189--
189190-- This can have an unexpected effect: Translating an image to less than (0,0) then to greater than
190191-- (0,0) will crop the image.
test/vty_issue_18.hs → test/Issue18.hsrenamed
The content is the same.
test/Issue76.hsnew file+17
@@ -0,0 +1,17 @@
1+module Main where
2+
3+import Control.Monad (void)
4+import Graphics.Vty
5+
6+main :: IO ()
7+main = do
8+ cfg <- standardIOConfig
9+ vty <- mkVty cfg
10+ let line1 = charFill (defAttr `withBackColor` blue) ' ' 10 1
11+ line2 = charFill (defAttr `withBackColor` green) ' ' 10 1
12+ img = translate 10 5 (line1 `vertJoin` line2)
13+ pic = picForImage img
14+
15+ update vty pic
16+ void $ nextEvent vty
17+ shutdown vty
test/yi_issue_264.hs → test/YiIssue264.hsrenamed
The content is the same.