From c814fa2cd5786259afebc49f6a86b35d167a14aa Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 23 Feb 2023 16:14:05 +0000 Subject: [PATCH] Move drawing of selection sections --- src/Dodge/SelectionSections/Draw.hs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/Dodge/SelectionSections/Draw.hs 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)