From 4c4dc9aa95ca86d58eb261fb19cbc62be67f92a0 Mon Sep 17 00:00:00 2001 From: Nikita Zlobin Date: Sun, 3 May 2020 14:28:14 +0500 Subject: [PATCH] Fix ugly rounded corners --- src/x11/x.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/x11/x.c b/src/x11/x.c index 6595d28..bc5daf2 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -110,10 +110,13 @@ static void x_win_round_corners(struct window_x11 *win, const int rad) /* To mark all pixels, which should get exposed, we * use a circle for every corner and two overlapping rectangles */ + int fw = settings.frame_width / 2 + settings.frame_width % 2; + if (fw < 1) + fw=1; unsigned const int centercoords[] = { - 0, 0, - width - dia - 1, 0, - 0, height - dia - 1, + -fw, -fw, + width - dia - 1, -fw, + -fw, height - dia - 1, width - dia - 1, height - dia - 1, }; @@ -123,8 +126,8 @@ static void x_win_round_corners(struct window_x11 *win, const int rad) shape_gc, centercoords[i], centercoords[i+1], - dia, - dia, + dia+fw, + dia+fw, degrees * 0, degrees * 360); }