Replace buggy circle seg intersection with a simpler test

This commit is contained in:
2024-12-26 21:53:18 +00:00
parent 91ba6ee148
commit 0ef28c132e
29 changed files with 528 additions and 332 deletions
+11 -8
View File
@@ -4,7 +4,6 @@ module Dodge.Render.HUD (
drawHUD,
) where
import Dodge.Item.InvSize
import Control.Applicative
import Control.Lens
import Control.Monad
@@ -29,6 +28,7 @@ import Dodge.Inventory
import Dodge.Item.Display
import Dodge.Item.Grammar
import Dodge.Item.Info
import Dodge.Item.InvSize
import Dodge.ListDisplayParams
import Dodge.Render.Connectors
import Dodge.Render.HUD.Carte
@@ -355,12 +355,13 @@ drawTerminalDisplay tid cfig w = fromMaybe mempty $ do
return $
invHead cfig (_tmTitle tm ++ ":T" ++ show tid)
<> drawSelectionList secondColumnParams cfig (thesellist tm)
<> color (withAlpha 0.5 green) -- consider integrating termScreenColor somehow
(drawSelectionListBackground secondColumnParams cfig tsize)
<> color
(withAlpha 0.5 green) -- consider integrating termScreenColor somehow
(drawSelectionListBackground secondColumnParams cfig tsize)
<> color (dark $ _tmExternalColor tm) (drawTitleBackground cfig)
where
toselitm (str, col) = SelectionItem [str] 1 55 True col 0 ()
-- not sure if the width (55) is correct here
-- not sure if the width (55) is correct here
thesellist tm = thelist tm
thelist tm =
map toselitm . displayTermInput tm
@@ -470,15 +471,17 @@ selNumPosCardinal ::
Maybe Point2
selNumPosCardinal card cfig ldp sss i j = do
ipos <- selSecYint i j sss
-- size <- selSecSelSize i j sss
-- size <- selSecSelSize i j sss
ysize <- fromIntegral <$> sss ^? ix i . ssItems . ix j . siHeight
xsize <- fromIntegral <$> sss ^? ix i . ssItems . ix j . siWidth
itmindent <- fromIntegral <$> sss ^? ix i . ssItems . ix j . siOffX
sindent <- fromIntegral <$> sss ^? ix i . ssIndent
let indent = itmindent + sindent
let offset = cardEightVec card * V2
(xsize * 0.5 * 10 * s)
(ysize * 0.5 * 20 * s)
let offset =
cardEightVec card
* V2
(xsize * 0.5 * 10 * s)
(ysize * 0.5 * 20 * s)
return $
screenPosAbs cfig (ldp ^. ldpPos)
+ offset