From 6f427fe4d6ba9a03f122d15839298040a7cfb925 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Tue, 24 Dec 2019 19:40:52 -0500 Subject: Fix circle rendering, add filled circle Make raster circle rendering use the Rasterific package instead of attempting desperately to hand-roll it, and add a method for generating filled circles. --- test/Xanthous/Util/GraphicsSpec.hs | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) (limited to 'test/Xanthous') diff --git a/test/Xanthous/Util/GraphicsSpec.hs b/test/Xanthous/Util/GraphicsSpec.hs index 4b761dc51fe9..ecd6dbe19197 100644 --- a/test/Xanthous/Util/GraphicsSpec.hs +++ b/test/Xanthous/Util/GraphicsSpec.hs @@ -15,19 +15,26 @@ test = testGroup "Xanthous.Util.Graphics" [ testGroup "circle" [ testCase "radius 12, origin 0" $ (sort . unique @[] @[_]) (circle @Int (0, 0) 12) - @?= (sort . unique) ( - let quadrant = - [ (0, 12) , (1, 12) , (2, 12) , (3, 12) - , (4, 12) , (5, 11) , (6, 11) , (7, 10) - , (8, 9) , (9, 9) , (9, 8) , (10, 7) - , (11, 6) , (11, 5) , (12, 4) , (12, 3) - , (12, 2) , (12, 1) , (12, 0) - ] - in quadrant - <> (quadrant <&> _1 %~ negate) - <> (quadrant <&> _2 %~ negate) - <> (quadrant <&> both %~ negate) - ) + @?= [ (1,12) + , (2,12) + , (3,12) + , (4,12) + , (5,12) + , (6,11) + , (7,10) + , (7,11) + , (8,10) + , (9,9) + , (10,7) + , (10,8) + , (11,6) + , (11,7) + , (12,1) + , (12,2) + , (12,3) + , (12,4) + , (12,5) + ] ] , testGroup "line" -- cgit 1.4.1