Refactor updates

This commit is contained in:
2022-10-28 23:13:36 +01:00
parent 14e2b5cf8f
commit 82e2a5a234
8 changed files with 64 additions and 63 deletions
+6 -6
View File
@@ -4,7 +4,7 @@ import Data.Foldable
import Data.Maybe
import Dodge.Base.WinScale
import Dodge.Base.Window
import Dodge.Data.Universe
import Dodge.Data.Config
import Geometry
import Picture
@@ -19,7 +19,8 @@ listPicturesAtOff tx ty cfig i = mconcat . zipWith (listTextPictureAt tx ty cfig
-- displays a cursor that should match up to list text pictures
-- the width of a character appears to be 9(?!)
-- this is probably because it is 8 pixels plus one for the border
listCursorChooseBorder :: [Bool] -> Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorChooseBorder ::
[Bool] -> Float -> Float -> Configuration -> Int -> Color -> Int -> Int -> Picture
listCursorChooseBorder borders xoff yoff cfig yint col cursxsize cursysize =
winScale cfig
. translate
@@ -66,12 +67,11 @@ fillScreenText cfig str =
. centerText
$ str
where
wscale = hw*0.02/fromIntegral (length str)
hscale = hh*0.01
wscale = hw * 0.02 / fromIntegral (length str)
hscale = hh * 0.01
hw = halfWidth cfig
hh = halfHeight cfig
fillWidthText :: Configuration -> String -> Picture
fillWidthText cfig str =
winScale cfig
@@ -79,7 +79,7 @@ fillWidthText cfig str =
. centerText
$ str
where
thescale = hw*0.02/fromIntegral (length str)
thescale = hw * 0.02 / fromIntegral (length str)
hw = halfWidth cfig
listTextPictureAt :: Float -> Float -> Configuration -> Int -> Picture -> Picture