Fix various display issues

This commit is contained in:
Kiana Sheibani 2021-12-28 18:17:19 -05:00
parent ed1deaef5f
commit d323ca2988
2 changed files with 3 additions and 2 deletions

View file

@ -51,7 +51,7 @@ instance Distributive ToroidalSpace where
instance Representable ToroidalSpace where
type Rep ToroidalSpace = (Int, Int)
index (TS s) (i, j) = s ! j ! i
index (TS s) (i, j) = s ! i ! j
tabulate f = TS $ V.generate 100 (\x -> V.generate 100 $ \y -> f (x, y))
instance Space ToroidalSpace where

View file

@ -32,4 +32,5 @@ drawGrid :: forall f. DisplayableSpace f => Config -> f Bool -> Picture
drawGrid config xs =
let (w, h) = windowSize config
size = fromIntegral $ if w > h then h `div` sizey @f else w `div` sizex @f
in color (cellColor config) $ pictures $ drawCells xs size
in translate (fromIntegral $ -w `div` 2) (fromIntegral $ -h `div` 2) $
color (cellColor config) $ pictures $ drawCells xs size