Fix mouse selection in menus

This commit is contained in:
2023-05-10 12:37:36 +01:00
parent cc42a5e124
commit 69fbf5926a
5 changed files with 16 additions and 24 deletions
+3 -4
View File
@@ -1,7 +1,6 @@
module Dodge.ScreenPos where
import Control.Lens
import Dodge.Base.Window
import Dodge.Data.Config
import Dodge.Data.ScreenPos
import Geometry.Data
@@ -13,9 +12,9 @@ fromTopLeft (V2 x y) = ScreenPos (V2 (-0.5) 0.5) (V2 x (- y))
translateScreenPos :: Configuration -> ScreenPos -> Picture -> Picture
translateScreenPos cfig sp = translate x y
where
V2 x y = sp ^. spScreenOff * V2 hw hh + sp ^. spPixelOff
hw = halfWidth cfig
hh = halfHeight cfig
V2 x y = sp ^. spScreenOff * V2 w h + sp ^. spPixelOff
w = fromIntegral $ cfig ^. windowX
h = fromIntegral $ cfig ^. windowY
screenPosAbs :: Configuration -> ScreenPos -> Point2
screenPosAbs = undefined