Fix terminal mouse over positioning

This commit is contained in:
2025-12-24 20:10:03 +00:00
parent 3cdab08184
commit de6bbe7697
5 changed files with 132 additions and 120 deletions
+1 -1
View File
@@ -364,7 +364,7 @@ drawTerminalDisplay w cfig tid = fold $ do
TerminalTextInput s -> (++ [(getPromptTM ++ s ++ [cFilledRect], white)])
TerminalPressTo s -> (++ [(s, white)])
return $
drawSelectionList (secondColumnLDP & ldpBorder ?~ (49, 16)) cfig f
drawSelectionList terminalLDP cfig f
<> drawTerminalCursorLink w cfig tm
where
-- <> tm ^. tmButtonID
+11
View File
@@ -15,6 +15,7 @@ module Dodge.Render.List (
drawTitleBackground, -- should be renamed, made sensible
drawCursorAt,
drawLabelledList,
ldpRect,
) where
import Data.Maybe
@@ -47,6 +48,16 @@ drawSelectionList ldps cfig sl =
(-5)
(10 * sf * fromIntegral x)
ldpRect :: Config -> LDParams -> Maybe (Point2, Point2) -- (NW, SE)
ldpRect cfig ldp = do
(x,y) <- ldp ^? ldpBorder . _Just
return $ ( V2 (-5) 5
, V2 (10 * sf * fromIntegral x) (negate $ (20 * sf + ygap) * fromIntegral y + 5)
) & each +~ screenPosAbs cfig (ldp ^. ldpPos)
where
sf = ldp ^. ldpScale
ygap = ldp ^. ldpVerticalGap
drawTitleBackground :: Config -> Picture
drawTitleBackground cfig =
translateScreenPos cfig (fromTopLeft (V2 (subInvX - 5) 75))