summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorUnoqwy <julien.qwy@gmail.com>2020-07-25 00:43:59 +0200
committerUnoqwy <julien.qwy@gmail.com>2020-08-07 19:49:33 +0200
commitba7b3155e0c3c9ff1da914322fba74629c153f61 (patch)
tree6a6b3de41e8c323b9f05d4683df0494d08b41fbd
parent45126039c7d1a7c990e83c644df984823aff6656 (diff)
downloadxmobar-ba7b3155e0c3c9ff1da914322fba74629c153f61.tar.gz
xmobar-ba7b3155e0c3c9ff1da914322fba74629c153f61.tar.bz2
Fix 1px-off borders
-rw-r--r--src/Xmobar/X11/Draw.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Xmobar/X11/Draw.hs b/src/Xmobar/X11/Draw.hs
index 8906da2..af8edc4 100644
--- a/src/Xmobar/X11/Draw.hs
+++ b/src/Xmobar/X11/Draw.hs
@@ -158,11 +158,10 @@ printStrings dr gc fontlist voffs offs a boxes sl@((s,c,i,l):xs) = do
(Icon p) -> liftIO $ maybe (return ())
(B.drawBitmap d dr gc fc bc offset valign)
(lookup p (iconS r))
- let x2 = offset + l - 1
let triBoxes = tBoxes c
dropBoxes = filter (\(_,b) -> not(b `elem` triBoxes)) boxes
- boxes' = map (\((x1,_),b) -> ((x1, x2), b)) (filter (\(_,b) -> b `elem` triBoxes) boxes)
- ++ map (\b -> ((offset - 1, x2), b)) (triBoxes \\ (map snd boxes))
+ boxes' = map (\((x1,_),b) -> ((x1, offset + l), b)) (filter (\(_,b) -> b `elem` triBoxes) boxes)
+ ++ map (\b -> ((offset, offset + l), b)) (triBoxes \\ (map snd boxes))
if Prelude.null xs
then liftIO $ drawBoxes d dr gc (fromIntegral ht) (dropBoxes ++ boxes')
else liftIO $ drawBoxes d dr gc (fromIntegral ht) dropBoxes
@@ -199,5 +198,5 @@ drawBoxBorder d dr gc pos alg offset ht (x1,x2) = do
case pos of
BBTop -> drawLine d dr gc (x1 + p1) 0 (x2 + p2) 0
BBBottom -> drawLine d dr gc (x1 + p1) (ht - 1) (x2 + p2) (ht - 1)
- BBLeft -> drawLine d dr gc x1 p1 x1 (ht + p2)
- BBRight -> drawLine d dr gc x2 p1 x2 (ht + p2)
+ BBLeft -> drawLine d dr gc (x1 - 1) p1 (x1 - 1) (ht + p2)
+ BBRight -> drawLine d dr gc (x2 - 1) p1 (x2 - 1) (ht + p2)