Tweak terminal screen drawing

This commit is contained in:
2026-04-06 10:03:48 +01:00
parent c041a4d174
commit 4723b45ef6
6 changed files with 97 additions and 92 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ secondColumnLDP = defaultLDP & ldpPos . spPixelOff .~ V2 subInvX (-20)
terminalLDP :: LDParams
terminalLDP = secondColumnLDP & ldpSize ?~ V2 50 16
& ldpPos . spScreenOff .~ V2 0.5 0.5
& ldpPos . spPixelOff .~ V2 (-250) (-40)
& ldpPos . spPixelOff .~ V2 (-250) 200
subInvX :: Float
subInvX = 10 * fromIntegral topInvW + 170
+11 -4
View File
@@ -372,10 +372,16 @@ drawTerminalDisplay w cfig tid = fold $ do
TerminalLineRead -> (++ [(spincurs, termTextColor)])
TerminalTextInput s -> (++ [(getPromptTM ++ s ++ [cFilledRect], white)])
TerminalPressTo s -> (++ [(s, white)])
return $
return . (each . vxPos . _z -~ 0.05) $
drawTerminalCursorLink w cfig tm
<> (
drawSelectionList (w ^. tmLDP) cfig f
<> drawTerminalCursorLink w cfig tm
<> (hackInvertText black white ("TERMINAL-" ++ show tid)
& each . vxPos *~ 0.1
& each . vxPos . _xy +~ rp)
& each . vxPos . _z -~ 0.05)
where
rp = screenPosAbs cfig (w ^. tmLDP . ldpPos)
-- <> invHead cfig ("TERMINAL-" ++ show tid)
-- <> color
-- (withAlpha 0.5 green) -- consider integrating termScreenColor somehow
@@ -391,7 +397,7 @@ drawTerminalCursorLink :: World -> Config -> Terminal -> Picture
drawTerminalCursorLink w cfig tm = fold $ do
j <- elemIndex (tm ^. tmButtonID) $ w ^. hud . closeButtons
lp <- selNumPos cfig invDP (w ^. hud . diSections) 5 j
let rp = screenPosAbs cfig (secondColumnLDP ^. ldpPos) - V2 5 10
let rp = screenPosAbs cfig (w ^. tmLDP . ldpPos)
lcol <- selSecSelCol 5 j (w ^. hud . diSections)
return $
translateScreenPos
@@ -403,7 +409,8 @@ drawTerminalCursorLink w cfig tm = fold $ do
(w ^. hud . diSections)
(Sel 5 j mempty)
)
<> lConnectCol (lp + V2 155 0) rp lcol white white
<>
lConnectCol (lp + V2 155 0) rp lcol white white
lnkMidPosInvSelsCol :: Config -> World -> Int -> Color -> [Int] -> Picture
lnkMidPosInvSelsCol cfig w i col = fromMaybe mempty . foldMap f
+1 -1
View File
@@ -40,7 +40,7 @@ drawSelectionList ldps cfig sl =
(drawListYgapScaleYoff ygap sf 0 (makeSelectionListPictures sl))
<> foldMap (g . f) (ldpRect cfig ldps)
where
g xs = color white (polygonWire xs) <> setDepth 0.5 (polygon xs)
g xs = color white (polygonWire xs) <> setDepth 0.05 (polygon xs)
ygap = ldps ^. ldpVerticalGap
sf = ldps ^. ldpScale
f (V2 xmin ymax, V2 xmax ymin) = rectNSWE ymax ymin xmin xmax
+1 -1
View File
@@ -136,7 +136,7 @@ setPixelOffsetBounded cfig (V2 x y) ldp = ldp & ldpPos . spPixelOff .~ V2 x' y'
w = fromIntegral $ cfig ^. windowX
x' = min (w - (w*a + 1+10*ldp ^?! ldpSize . _Just . _x . to fromIntegral))
$ max (1 - w * a) x
y' = min (h-(h*b + 40))
y' = min (h-(h*b + 20))
$ max (1+20*(ldp^.ldpVerticalGap + ldp^?!ldpSize._Just._y.to fromIntegral)-h*b) y
V2 a b = ldp ^. ldpPos . spScreenOff
+5 -5
View File
@@ -42,7 +42,7 @@ module Picture.Base (
color,
zeroZ,
setDepth,
addDepth,
-- addDepth,
setLayer,
mirroryz,
mirrorxz,
@@ -122,10 +122,10 @@ setDepth :: Float -> Picture -> Picture
--setDepth d = map $ second $ overPos (\(x,y,_) -> (x,y,d))
setDepth d = fmap $ overPos (\(V3 x y _) -> V3 x y d)
addDepth :: Float -> Picture -> Picture
{-# INLINE addDepth #-}
--addDepth d = map $ second $ overPos (\(x,y,z) -> (x,y,z+d))
addDepth d = fmap $ overPos (\(V3 x y z) -> V3 x y (z + d))
--addDepth :: Float -> Picture -> Picture
--{-# INLINE addDepth #-}
----addDepth d = map $ second $ overPos (\(x,y,z) -> (x,y,z+d))
--addDepth d = fmap $ overPos (\(V3 x y z) -> V3 x y (z + d))
-- TODO change the Int here to a dedicated type
setLayer :: Layer -> Picture -> Picture