~alcinnz/CatTrap

ref: d0a8a7d61e0a8340adcb597e0c8f94553dbaff81 CatTrap/Graphics/Layout/Grid.hs -rw-r--r-- 682 bytes
d0a8a7d6 — Adrian Cochrane Finish drafting shunting yard interpreter for calc(). 1 year, 9 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module Graphics.Layout.Grid where

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

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)])]