cellBounds method
Converts grid coordinates to world bounds.
Given grid cell coordinates (x, y), returns the bounding rectangle in world/pixel coordinates.
Implementation
Rect cellBounds(int cellX, int cellY) {
return Rect.fromLTWH(
cellX * gridSize,
cellY * gridSize,
gridSize,
gridSize,
);
}