Make dragging behaviour consistent when dragging up and down
This causes a slight gap when dragging backwards and forwards over large items
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
/home/justin/Haskell/loop/src/Dodge/Update/Input/InGame.hs:247:22-23: warning: [-Wunused-matches]
|
||||
Defined but not used: ‘bn’
|
||||
|
|
||||
247 | shiftInvItems k x ab bn xs ss w = fromMaybe w $ do
|
||||
| ^^
|
||||
/home/justin/Haskell/loop/src/Dodge/Update/Input/InGame.hs:252:13-17: warning: [-Wunused-matches]
|
||||
Defined but not used: ‘above’
|
||||
|
|
||||
|
||||
@@ -251,13 +251,13 @@ shiftInvItems k x ab bn xs ss w = fromMaybe w $ do
|
||||
then do
|
||||
above <- ss ^? ix (mini - 1)
|
||||
guard $ Just (k,mini-1) /= ab
|
||||
-- minss <- IM.lookupMin ss
|
||||
-- guard (mini > fst minss)
|
||||
return $ shiftInvItemsUp k xs w
|
||||
else do
|
||||
guard $ x > (k,maxi)
|
||||
maxss <- IM.lookupMax ss
|
||||
guard (maxi < fst maxss)
|
||||
--guard $ x > (k,maxi)
|
||||
--maxss <- IM.lookupMax ss
|
||||
--guard (maxi < fst maxss)
|
||||
_ <- ss ^? ix (maxi + 1)
|
||||
guard $ Just (k,maxi+1) < bn
|
||||
return $ shiftInvItemsDown k xs w
|
||||
|
||||
shiftInvItemsUp :: Int -> IS.IntSet -> World -> World
|
||||
|
||||
Reference in New Issue
Block a user