Work on combine cursors

This commit is contained in:
2023-02-17 18:00:40 +00:00
parent 30ce713534
commit 90133fb54b
5 changed files with 91 additions and 43 deletions
+9 -1
View File
@@ -1,6 +1,7 @@
module Dodge.Render.List where
--import Picture.Text
import Dodge.Inventory
import SelectionIntMap
import qualified Data.IntMap.Strict as IM
--import Data.Foldable
@@ -109,6 +110,13 @@ stackPicturesAt tx ty cfig = stackPicturesAtOff tx ty cfig 0
stackPicturesAtOff :: Float -> Float -> Configuration -> Int -> [Picture] -> Picture
stackPicturesAtOff tx ty cfig i = mconcat . zipWith (listTextPictureAt tx ty cfig) [i, i -1 ..]
selSecDrawCursor :: Int -> [CardinalPoint] -> Configuration -> ListDisplayParams -> SelectionSections a -> Int -> Int -> Picture
selSecDrawCursor xsize borders cfig ldp sss i j = fromMaybe mempty $ do
yint <- selSecSelPos i j sss
xint <- sss ^? sssSections . ix i . ssIndent
si <- sss ^? sssSections . ix i . ssItems . ix j
return $ listCursorDisplayParams ldp borders cfig yint xint (_siColor si) xsize (length $ _siPictures si)
listCursorDisplayParams ::
ListDisplayParams ->
[CardinalPoint] ->
@@ -153,7 +161,7 @@ listCursorChooseBorderScale ygap s borders xoff yoff cfig yint xint col cursxsiz
where
x = 9
wth = x * fromIntegral cursxsize + 9
hgt = 20 * fromIntegral cursysize
hgt = 20 * fromIntegral cursysize -- TODO this should be changed!
-- displays a cursor that should match up to list text pictures
-- the width of a character appears to be 9(?!)