Add limit to forcefield size

This commit is contained in:
2022-06-07 16:08:18 +01:00
parent 1c80447f9a
commit f938f9a717
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -94,9 +94,10 @@ targetDistanceDraw itm _ cfig w = fromMaybe mempty $ do
let p1 = worldPosToScreen w p
mwp = mouseWorldPos w
p2 = worldPosToScreen w mwp
thecol = if dist p mwp > 100 then red else white
return $ winScale cfig
$ setLayer FixedCoordLayer
$ color white
$ color thecol
$ line [p1, p2]
<> translate (20) (f p1 p2) (uncurryV translate (0.5 *.* (p1 +.+ p2)) . scale 0.1 0.1 $ text $ shortShow $ dist p mwp)
where