fix animation sorting. hopefuly finally

This commit is contained in:
nek0 2019-02-16 02:21:48 +01:00
parent 414dd39c00
commit 5144588366

View file

@ -701,10 +701,16 @@ drawTile ud ctx posanims pr pc row col img =
-- any (\m -> nc > fromIntegral (floor nc :: Int) + m) mincs -- any (\m -> nc > fromIntegral (floor nc :: Int) + m) mincs
tileWidth = 64 :: Double tileWidth = 64 :: Double
tileHeight = 32 :: Double tileHeight = 32 :: Double
sorted = sortOn (\(V2 sr sc, _, mbnds) -> case mbnds of sorted = sortOn (\(V2 sr sc, _, mbnds) ->
Just (Boundaries (_, _) (maxr, maxc)) -> maxr + (1 - maxc) * 10 let comp srow scol = (floor $ (1 - scol) * 10) + (floor $ srow * 100)
_ -> (sr - (fromIntegral ((floor sr) :: Int))) + in
(1 - (sc - (fromIntegral ((floor sc) :: Int)))) * 10 case mbnds of
Just (Boundaries (minr, minc) (maxr, maxc)) ->
comp maxr minc
_ ->
comp
(sr - (fromIntegral ((floor sr) :: Int)))
(sc - (fromIntegral ((floor sc) :: Int)))
) posanims ) posanims
-- sorted = posanims -- sorted = posanims
minrs = Prelude.map (fst . matmin) mb minrs = Prelude.map (fst . matmin) mb