From d000cbb52821dc33c5d2f3d676dc6efa54f3b25f Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sat, 28 Dec 2024 21:36:39 +0530 Subject: Move hints mode state inside ModeHints constructor --- src/Chelleport/Draw.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Chelleport/Draw.hs') diff --git a/src/Chelleport/Draw.hs b/src/Chelleport/Draw.hs index dbda1c1..afb72ca 100644 --- a/src/Chelleport/Draw.hs +++ b/src/Chelleport/Draw.hs @@ -78,10 +78,10 @@ fillRectVertices :: (MonadDraw m) => (CInt, CInt) -> (CInt, CInt) -> m () fillRectVertices (x1, y1) (x2, y2) = fillRect (x1, y1) (x2 - x1, y2 - y1) cellSize :: (MonadDraw m) => State -> m (CInt, CInt) -cellSize (State {stateGrid}) = do +cellSize (State {stateGridRows, stateGridCols}) = do (width, height) <- windowSize - let wcell = width `div` intToCInt (length $ head stateGrid) - let hcell = height `div` intToCInt (length stateGrid) + let wcell = width `div` intToCInt stateGridCols + let hcell = height `div` intToCInt stateGridRows pure (wcell, hcell) pointerPositionIncrement :: (MonadDraw m) => State -> m (CInt, CInt) -- cgit v1.3.1