Refactor window size, update selection cursor on new screen

This commit is contained in:
2023-03-25 09:27:27 +00:00
parent 20c05be23f
commit ea0c942887
57 changed files with 346 additions and 310 deletions
+3 -7
View File
@@ -20,8 +20,8 @@ import qualified Data.Text as T
import Dodge.Concurrent
import Dodge.Data.Universe
import Dodge.Event.Input
import Preload.Update
import LensHelp
import Preload.Update
import SDL
handleEvent :: Event -> Universe -> Universe
@@ -48,14 +48,10 @@ handleWindowMoveEvent mev =
where
P (V2 x y) = windowMovedEventPosition mev
-- | Resets the world window size, and resizes the fbo that gets the light map drawn into it.
-- using a sideeffect here for the io change seems to work better, more testing
-- later may be a good idea
handleResizeEvent :: WindowSizeChangedEventData -> Universe -> Universe
handleResizeEvent sev u =
u
& uvIOEffects %~ ( (updatePreload . updateconfig) >=>)
handleResizeEvent sev = uvIOEffects %~ ((updatePreload . updateconfig) >=>)
where
updateconfig = (uvConfig . windowX .~ fromIntegral x) . (uvConfig . windowY .~ fromIntegral y)
updateconfig = (uvConfig . windowX .~ fromIntegral x) . (uvConfig . windowY .~ fromIntegral y)
V2 x y = windowSizeChangedEventSize sev