~alcinnz/CatTrap

ref: 3dce4d79a99984588660089433a6a7eb78701300 CatTrap/Graphics/Layout/Grid.hs -rw-r--r-- 760 bytes
3dce4d79 — Adrian Cochrane Unit test calc() implementation! 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
module Graphics.Layout.Grid where

import Data.Text (Text)
import Graphics.Layout.Box

data Grid n = Grid {
    rows :: [(Name, Either n Double)],
    columns :: [(Name, Either n Double)],
    gap :: Size n,
    gridBox :: PaddedBox n
}
data GridItem n = GridItem {
    startRow :: Int, endRow :: Int, startCol :: Int, endCol :: Int,
    gridItemBox :: PaddedBox n
}

type Name = Text

{-sizeBoundGrid :: Grid Length -> [GridItem Length] -> Grid Length
sizeGrid :: PaddedBox Double -> Grid Length -> Grid Double
sizeGridItem :: Grid Length -> GridItem Length -> Grid Double
positionGrid :: Grid Double -> [GridItem Double] -> [Size]
layoutGrid :: PaddedBox Double -> Grid Length -> [GridItem Length] -> Bool ->
    [(Grid Double, [(Size, GridItem Double)])]-}