Fix terminal mouse over positioning
This commit is contained in:
+10
-12
@@ -3,6 +3,7 @@
|
||||
|
||||
module Dodge.Update (updateUniverse) where
|
||||
|
||||
import Dodge.Render.List
|
||||
import Data.Foldable
|
||||
import qualified Data.Set as S
|
||||
import Color
|
||||
@@ -399,19 +400,16 @@ getMenuMouseContext screen u = case screen ^. scOptions of
|
||||
return $ if t then MouseMenuClick yi else NoMouseContext
|
||||
|
||||
isOverTerminalScreen :: Config -> Point2 -> Bool
|
||||
isOverTerminalScreen cfig (V2 x y) =
|
||||
x <= xmax
|
||||
&& x >= xmin - 5
|
||||
&& y <= ymax + 5
|
||||
&& y >= ymin
|
||||
isOverTerminalScreen cfig (V2 x y) = fromMaybe False $ do
|
||||
(V2 xmin ymax, V2 xmax ymin) <- ldpRect cfig terminalLDP
|
||||
return $ x <= xmax && x >= xmin && y <= ymax && y >= ymin
|
||||
where
|
||||
--ldp = secondColumnLDP
|
||||
ldp = invDP
|
||||
V2 xmin ymax = screenPosAbs cfig (ldp ^. ldpPos)
|
||||
tsize = fromIntegral $ getMaxLinesTM + 1
|
||||
s = 5 + tsize * (20 * ldp ^. ldpScale + ldp ^. ldpVerticalGap)
|
||||
ymin = ymax - s
|
||||
xmax = xmin + 555 -- HACK drawSelectionListBackground
|
||||
-- ldp = terminalLDP
|
||||
-- V2 xmin ymax = screenPosAbs cfig (ldp ^. ldpPos)
|
||||
-- tsize = fromIntegral $ getMaxLinesTM + 1
|
||||
-- s = 5 + tsize * (20 * ldp ^. ldpScale + ldp ^. ldpVerticalGap)
|
||||
-- ymin = ymax - s
|
||||
-- xmax = xmin + 555 -- HACK drawSelectionListBackground
|
||||
|
||||
updateWheelEvents :: World -> World
|
||||
updateWheelEvents w = case w ^. input . scrollAmount of
|
||||
|
||||
Reference in New Issue
Block a user