aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport/Draw.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-28 21:36:39 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-28 21:36:39 +0530
commitd000cbb52821dc33c5d2f3d676dc6efa54f3b25f (patch)
tree7d4d51082b3b7ddf4f3b94879383efb003a87394 /src/Chelleport/Draw.hs
parentb305546950a6742f25023e2ffece423905e1bda8 (diff)
downloadchelleport-d000cbb52821dc33c5d2f3d676dc6efa54f3b25f.tar.gz
chelleport-d000cbb52821dc33c5d2f3d676dc6efa54f3b25f.zip
Move hints mode state inside ModeHints constructor
Diffstat (limited to 'src/Chelleport/Draw.hs')
-rw-r--r--src/Chelleport/Draw.hs6
1 files changed, 3 insertions, 3 deletions
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)