Fix bugs in zoning
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
module Dodge.Render.Label
|
||||
where
|
||||
import Dodge.Base.Coordinate
|
||||
import Dodge.ShortShow
|
||||
import Dodge.Base.WinScale
|
||||
import Picture
|
||||
import Dodge.Data.Universe
|
||||
import Geometry
|
||||
|
||||
drawLabCrossCol :: Configuration -> World -> Color -> Point2 -> Picture
|
||||
drawLabCrossCol cfig w col p = drawCrossCol col p
|
||||
<> drawPointLabel cfig w p
|
||||
|
||||
drawPointLabel :: Configuration -> World -> Point2 -> Picture
|
||||
drawPointLabel cfig w p =
|
||||
setLayer FixedCoordLayer . winScale cfig
|
||||
. uncurryV translate p'
|
||||
. scale 0.1 0.1
|
||||
. text
|
||||
$ shortPoint2 p
|
||||
where
|
||||
p' = worldPosToScreen w p
|
||||
|
||||
drawCrossCol :: Color -> Point2 -> Picture
|
||||
drawCrossCol col p = setLayer DebugLayer . color col . uncurryV translate p $ crossPic 5
|
||||
|
||||
drawCross :: Point2 -> Picture
|
||||
drawCross = drawCrossCol red
|
||||
|
||||
crossPic :: Float -> Picture
|
||||
crossPic x = line [V2 x x, V2 (- x) (- x)] <> line [V2 (- x) x, V2 x (- x)]
|
||||
Reference in New Issue
Block a user