packages feed

gluturtle 0.0.39 → 0.0.43

raw patch · 4 files changed

+14/−5 lines, 4 files

Files

gluturtle.cabal view
@@ -2,7 +2,7 @@ cabal-version:	>= 1.6  name:		gluturtle-version:	0.0.39+version:	0.0.43 stability:	alpha author:		Yoshikuni Jujo <PAF01143@nifty.ne.jp> maintainer:	Yoshikuni Jujo <PAF01143@nifty.ne.jp>
src/Graphics/UI/GLUT/Turtle.hs view
@@ -119,8 +119,9 @@ import qualified Text.XML.YJSVG as S(center, topleft)  import Control.Concurrent(killThread, newChan, writeChan, getChanContents)-import Control.Monad(replicateM_, zipWithM_)+import Control.Applicative((<$>)) import Control.Arrow((&&&))+import Control.Monad(replicateM_, zipWithM_) import Data.IORef(IORef, newIORef, readIORef) import Data.IORef.Tools(atomicModifyIORef_) import Data.Fixed(mod')@@ -168,7 +169,14 @@ runInputs = mapM_ . input  getSVG :: Turtle -> IO [SVG]-getSVG = fmap reverse . flip info drawed+getSVG = (<$>) processFill . fmap reverse . flip info drawed++processFill :: [SVG] -> [SVG]+processFill svgs = last (filter isFill svgs) : filter (not . isFill) svgs++isFill :: SVG -> Bool+isFill (Fill _) = True+isFill _ = False  convertPosition :: Turtle -> Position -> IO Position convertPosition t p = do
src/Graphics/UI/GLUT/Turtle/Input.hs view
@@ -83,7 +83,7 @@ 	Just (Text (position t) sz clr fnt str) nextTurtle t (PutImage fp w h) = reset t `set` Just (Image (position t) w h fp) nextTurtle t (Undonum un) = (reset t){undonum = un}-nextTurtle t Clear = (reset t){clear = True, drawed = [last $ drawed t]}+nextTurtle t Clear = (reset t){clear = True, drawed = []} nextTurtle t (Sleep time) = (reset t){sleep = Just time} nextTurtle t Flush = (reset t){flush = True} nextTurtle t (Shape sh) = (reset t){shape = sh}@@ -92,7 +92,7 @@ nextTurtle t (Pencolor clr) = (reset t){pencolor = clr} nextTurtle t (Fillcolor clr) = (reset t){fillcolor = clr} nextTurtle t (Bgcolor clr) = (reset t){-	draw = Just $ Fill clr, drawed = init (drawed t) ++ [Fill clr]}+	draw = Just $ Fill clr, drawed = Fill clr : drawed t} nextTurtle t (SetPendown pd) = (reset t){pendown = pd} nextTurtle t (SetVisible v) = (reset t){visible = v} nextTurtle t (SetFill fl) = (reset t){fill = fl, fillPoints = [position t | fl]}
tests/testGLUT.hs view
@@ -51,4 +51,5 @@ processInput f _ _ "center" = center f >> return True processInput _ _ t "goto100" = goto t 100 100 >> return True processInput _ _ t "clear" = clear t >> return True+processInput _ _ t "svg" = getSVG t >>= print >> return True processInput _ _ _ _ = return True