Move drawing of selection sections

This commit is contained in:
2023-02-23 16:14:05 +00:00
parent 86943f4170
commit c814fa2cd5
+26
View File
@@ -0,0 +1,26 @@
module Dodge.SelectionSections.Draw where
import Dodge.Data.CardinalPoint
import Control.Lens
import Data.Maybe
import Picture.Data
import Dodge.Data.Config
import Dodge.Render.List
import Dodge.Data.SelectionList
drawSelectionSections :: SelectionSections a -> ListDisplayParams -> Configuration -> Picture
drawSelectionSections sss ldps cfig =
listPicturesAtScaleOff
(_ldpVerticalGap ldps)
(_ldpScale ldps)
(_ldpPosX ldps)
(_ldpPosY ldps)
cfig
0
pics
<> thecursor'
where
thecursor' = fromMaybe mempty $ do
(i, j) <- sss ^? sssExtra . sssSelPos . _Just
return $ selSecDrawCursor 15 [North, South, West] cfig ldps sss i j
pics = foldMap _ssShownItems (_sssSections sss)