Fix bug when dragging items
This commit is contained in:
@@ -258,15 +258,19 @@ shiftInvItems k x ab bn xs ss w = setSelWhileDragging . fromMaybe w $ do
|
||||
guard $ xk == k || xk + 1 == k || xk -1 == k
|
||||
(maxi,_) <- IS.maxView xs
|
||||
(mini,_) <- IS.minView xs
|
||||
if x < (k,mini)
|
||||
then do
|
||||
case True of
|
||||
_ | x < (k,mini) -> do
|
||||
guard $ not . null . fst $ IM.split mini ss
|
||||
guard $ Just (k,mini-1) /= ab
|
||||
return $ shiftInvItemsUp k xs w
|
||||
else do
|
||||
_ | x > (k,maxi) -> do
|
||||
guard $ not . null . snd $ IM.split maxi ss
|
||||
guard $ Just (k,maxi+1) /= bn
|
||||
return $ shiftInvItemsDown k xs w
|
||||
_ -> Nothing
|
||||
-- if x < (k,mini)
|
||||
-- then
|
||||
-- else
|
||||
|
||||
setSelWhileDragging :: World -> World
|
||||
setSelWhileDragging w = fromMaybe w $ do
|
||||
|
||||
Reference in New Issue
Block a user