Fix -Wincomplete-record-updates warnings

(undefined has `HasCallStack =>` so this will give a useful error
message if anyone ever makes the code fail)
This commit is contained in:
Tomas Janousek 2021-10-31 17:51:58 +00:00
parent b83f49d90b
commit 5f3a6210a2

View File

@ -425,13 +425,14 @@ resizeSplit :: Direction2D -> (Rational,Rational) -> Zipper Split -> Maybe (Zipp
resizeSplit _ _ z@(_, []) = Just z
resizeSplit dir (xsc,ysc) z = case goToBorder dir z of
Nothing -> Just z
Just (t, crumb) -> Just $ case dir of
Just (t@Node{}, crumb) -> Just $ case dir of
R -> (t{value=sp{ratio=scaleRatio (ratio sp) xsc}}, crumb)
D -> (t{value=sp{ratio=scaleRatio (ratio sp) ysc}}, crumb)
L -> (t{value=sp{ratio=1-scaleRatio (1-ratio sp) xsc}}, crumb)
U -> (t{value=sp{ratio=1-scaleRatio (1-ratio sp) ysc}}, crumb)
where sp = value t
scaleRatio r fac = min 0.9 $ max 0.1 $ r*fac
Just (Leaf{}, _) -> undefined
-- starting from a leaf, go to node representing a border of the according window
goToBorder :: Direction2D -> Zipper Split -> Maybe (Zipper Split)