Fix ellipse shader coordinates

This commit is contained in:
jgk
2021-06-24 21:20:14 +02:00
parent bae8a4ed94
commit 6320093473
4 changed files with 22 additions and 13 deletions
+2 -2
View File
@@ -10,12 +10,12 @@ import Dodge.Picture.Layer.Data
import Picture
{- | Uses a layer to set the depth. -}
onLayer :: Layer -> Picture -> Picture
onLayer l = setDepth $ (1 - fromIntegral (levLayer l) / 100) / 100
onLayer l = setDepth $ (1 - fromIntegral (levLayer l) / 100) / 1000
{- | Set a depth according to a list of numbers.
Lists are lexicographically ordered if input values are always less than 100.
Higher numbers will get placed on top of lower numbers. -}
onLayerL :: [Int] -> Picture -> Picture
onLayerL is = setDepth (1 - sum (zipWith (/) (map fromIntegral is) $ map (100 **) [1..]))
onLayerL is = setDepth $ (1 - sum (zipWith (/) (map fromIntegral is) $ map (100 **) [1..])) / 1000
{- | For depth testing, set layer values. -}
levLayer :: Layer -> Int
levLayer BgLayer = 20