Fix various display issues
This commit is contained in:
parent
ed1deaef5f
commit
d323ca2988
|
@ -51,7 +51,7 @@ instance Distributive ToroidalSpace where
|
||||||
|
|
||||||
instance Representable ToroidalSpace where
|
instance Representable ToroidalSpace where
|
||||||
type Rep ToroidalSpace = (Int, Int)
|
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))
|
tabulate f = TS $ V.generate 100 (\x -> V.generate 100 $ \y -> f (x, y))
|
||||||
|
|
||||||
instance Space ToroidalSpace where
|
instance Space ToroidalSpace where
|
||||||
|
|
|
@ -32,4 +32,5 @@ drawGrid :: forall f. DisplayableSpace f => Config -> f Bool -> Picture
|
||||||
drawGrid config xs =
|
drawGrid config xs =
|
||||||
let (w, h) = windowSize config
|
let (w, h) = windowSize config
|
||||||
size = fromIntegral $ if w > h then h `div` sizey @f else w `div` sizex @f
|
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
|
Loading…
Reference in a new issue