'XMonad.Util.Rectangle': 'withBorder' fixes

Fix handling of negative borders in 'withBorder'.
This commit is contained in:
Yclept Nemo 2018-04-19 18:23:46 -04:00
parent cc00a93f1a
commit 31bfcc217f

View File

@ -179,12 +179,12 @@ withBorder t b r l i (Rectangle x y w h) =
bh = w' - iw
bv = h' - ih
-- scaled border ratios
rh = if l + r == 0
rh = if l + r <= 0
then 1
else min 1 $ abs $ bh % (l + r)
rv = if t + b == 0
else min 1 $ bh % (l + r)
rv = if t + b <= 0
then 1
else min 1 $ abs $ bv % (t + b)
else min 1 $ bv % (t + b)
-- scaled border pixels
t' = truncate $ rv * fromIntegral t
b' = truncate $ rv * fromIntegral b