From 74cbfdcda4d91b8914340d25cf78f5c85e7f2e8c Mon Sep 17 00:00:00 2001 From: vaxerski <43317083+vaxerski@users.noreply.github.com> Date: Fri, 5 Aug 2022 22:21:14 +0200 Subject: [PATCH] guard zero border --- src/render/OpenGL.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp index 5ad9ce7a..a9338b88 100644 --- a/src/render/OpenGL.cpp +++ b/src/render/OpenGL.cpp @@ -741,9 +741,11 @@ void CHyprOpenGLImpl::renderBorder(wlr_box* box, const CColor& col, int round) { static auto *const PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue; static auto *const PMULTISAMPLE = &g_pConfigManager->getConfigValuePtr("decoration:multisample_edges")->intValue; + if (*PBORDERSIZE < 1) + return; + if (round < 1) { // zero rounding, just lines - wlr_box borderbox = {box->x - *PBORDERSIZE, box->y - *PBORDERSIZE, *PBORDERSIZE, box->height + 2 * *PBORDERSIZE}; renderRect(&borderbox, col, 0); // left borderbox = {box->x, box->y - (int)*PBORDERSIZE, box->width + (int)*PBORDERSIZE, (int)*PBORDERSIZE};