Fix terminal mouse over positioning
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user