diff --git a/src/Dodge/SelectionSections/Draw.hs b/src/Dodge/SelectionSections/Draw.hs new file mode 100644 index 000000000..4fc239fd0 --- /dev/null +++ b/src/Dodge/SelectionSections/Draw.hs @@ -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)