This commit is contained in:
2022-12-27 10:53:31 +00:00
parent eecc38d68f
commit 2def9800fa
6 changed files with 28 additions and 40 deletions
+8 -10
View File
@@ -2,8 +2,6 @@ module Dodge.Render.List where
import Data.Foldable
import Data.Maybe
import Data.Set (Set)
import qualified Data.Set as Set
import Dodge.Base.WinScale
import Dodge.Base.Window
import Dodge.Data.CardinalPoint
@@ -74,7 +72,7 @@ stackPicturesAtOff tx ty cfig i = mconcat . zipWith (listTextPictureAt tx ty cfi
listCursorChooseBorderScale ::
Float ->
Float ->
Set CardinalPoint ->
[CardinalPoint] ->
Float ->
Float ->
Configuration ->
@@ -99,12 +97,12 @@ listCursorChooseBorderScale ygap s borders xoff yoff cfig yint col cursxsize cur
-- the width of a character appears to be 9(?!)
-- this is probably because it is 8 pixels plus one for the border
listCursorChooseBorder ::
Set CardinalPoint -> Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
[CardinalPoint] -> Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorChooseBorder = listCursorChooseBorderScale 10 1
-- note we cannot simply scale lines because they are drawn as solid rectangles
chooseCursorBorders :: Float -> Float -> Set CardinalPoint -> Picture
chooseCursorBorders wth hgt = fold . Set.map (line . toLine)
chooseCursorBorders :: Float -> Float -> [CardinalPoint] -> Picture
chooseCursorBorders wth hgt = fold . map (line . toLine)
where
top = 0
bot = - hgt
@@ -115,16 +113,16 @@ chooseCursorBorders wth hgt = fold . Set.map (line . toLine)
toLine West = [V2 lef bot, V2 lef top]
listCursorNS :: Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorNS = listCursorChooseBorder (Set.fromList [North, South])
listCursorNS = listCursorChooseBorder [North, South]
listCursorNES :: Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorNES = listCursorChooseBorder (Set.fromList [North, South, East])
listCursorNES = listCursorChooseBorder [North, South, East]
listCursorNESW :: Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorNESW = listCursorChooseBorder (Set.fromList [North, South, East, West])
listCursorNESW = listCursorChooseBorder [North, South, East, West]
listCursorNSW :: Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorNSW = listCursorChooseBorder (Set.fromList [North, South, West])
listCursorNSW = listCursorChooseBorder [North, South, West]
fillScreenText :: Configuration -> String -> Picture
fillScreenText cfig str =