From f729e5a2982bd0fe61358b9d1eb7dfb0f9961dec Mon Sep 17 00:00:00 2001 From: jgk Date: Wed, 10 Mar 2021 04:09:18 +0100 Subject: [PATCH] Render circles as ellipses, allows for proper scaling --- src/Dodge/Weapons.hs | 6 +----- src/Picture/Render.hs | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Dodge/Weapons.hs b/src/Dodge/Weapons.hs index 997cd0074..6e3cabbe8 100644 --- a/src/Dodge/Weapons.hs +++ b/src/Dodge/Weapons.hs @@ -1033,11 +1033,7 @@ moveFlame rotd w pt = $ scale scaleChange 1 -- $ color white -- $ circleSolid 5 --- $ pictures $ reverse [color white $ circleSolid 4 - $ pictures $ reverse - [color red $ ellipseSolid (-2,0) (2,0) 6 - --,color white $ ellipseSolid (2,0) (-2,0) 6 - --,color white $ ellipseSolid (2,0) (-2,0) 6 + $ pictures $ reverse [color white $ circleSolid 4 ,color (withAlpha 0.5 white) $ circleSolid 5 ] -- $ rotate (radToDeg (fromIntegral time * 10)) diff --git a/src/Picture/Render.hs b/src/Picture/Render.hs index 745067373..a3e40850a 100644 --- a/src/Picture/Render.hs +++ b/src/Picture/Render.hs @@ -166,7 +166,11 @@ picToLTree mx (PolygonCol i vs) in LLeaf $ RenderPoly $ zip (map zeroZ $ polyToTris ps) $ polyToTris cs | otherwise = LBranches [] picToLTree mx (Circle i r) - | Just i == mx || Nothing == mx = LLeaf $ RenderCirc $ ((0,0,0),black,r) + | Just i == mx || Nothing == mx = LLeaf $ RenderEllipse + [((-r, r,0), black) + ,((-r,-r,0), black) + ,(( r,-r,0), black) + ] | otherwise = LBranches [] picToLTree mx (Ellipse i (ax,ay) (bx,by) r) | Just i == mx || Nothing == mx = LLeaf $ RenderEllipse [((ax,ay+r,0),black)