Refactor window size, update selection cursor on new screen
This commit is contained in:
+3
-7
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user