Files
loop/src/Dodge/SelectionList.hs
T
2024-10-25 21:05:32 +01:00

19 lines
541 B
Haskell

module Dodge.SelectionList (
getAvailableListLines,
) where
import Dodge.Data.ScreenPos
import Dodge.Data.Universe
import LensHelp
import Linear
getAvailableListLines :: ListDisplayParams -> Configuration -> Int
getAvailableListLines ldps cfig = floor ((dToBot - vgap) / itmHeight)
where
vgap = ldps ^. ldpVerticalGap
itmHeight = 20 * ldps ^. ldpScale + vgap
winy = fromIntegral $ cfig ^. windowY
dToBot =
winy / 2 + winy * (ldps ^. ldpPos . spScreenOff . _y)
+ (ldps ^. ldpPos . spPixelOff . _y)