From b5e397b1fdb9867b1d4ac599c88ef8b6354b5782 Mon Sep 17 00:00:00 2001 From: jao Date: Fri, 2 Jun 2023 23:45:55 +0100 Subject: center middle section for templates of the form "}M{" (fixes #677) --- src/Xmobar/Draw/Cairo.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Xmobar/Draw/Cairo.hs b/src/Xmobar/Draw/Cairo.hs index 36f9bde..8dcda5d 100644 --- a/src/Xmobar/Draw/Cairo.hs +++ b/src/Xmobar/Draw/Cairo.hs @@ -2,7 +2,7 @@ ------------------------------------------------------------------------------ -- | -- Module: Xmobar.X11.Cairo --- Copyright: (c) 2022 Jose Antonio Ortega Ruiz +-- Copyright: (c) 2022, 2023 Jose Antonio Ortega Ruiz -- License: BSD3-style (see LICENSE) -- -- Maintainer: jao@gnu.org @@ -185,7 +185,7 @@ drawSegments dctx surf = do (lend, as, bx) <- foldM (drawSegment dctx surf dw) (0, [], []) llyts let [rw, cw] = map sWidth [rlyts, clyts] rstart = max lend (dw - rw) - cstart = if lend > 1 then max lend ((dw - cw) / 2.0) else lend + cstart = if lend > 1 || rw == 0 then max lend ((dw - cw) / 2.0) else lend (_, as', bx') <- if cw > 0 then foldM (drawSegment dctx surf rstart) (cstart, as, bx) clyts else return (0, as, bx) -- cgit v1.2.3