summaryrefslogtreecommitdiff
path: root/src/render/OpenGL.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-04 17:21:01 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-04 17:21:01 +0200
commit3947fe9e9f8fb2912b969a20fbbec3f2ab62cef0 (patch)
tree192f3dbf1e46818e0e857a62112972844c5761a9 /src/render/OpenGL.cpp
parentc7c0149c082714901697483669c8b382865885cf (diff)
simplify border rendering when rounding is 0
Diffstat (limited to 'src/render/OpenGL.cpp')
-rw-r--r--src/render/OpenGL.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/render/OpenGL.cpp b/src/render/OpenGL.cpp
index 3df67aa8..5ad9ce7a 100644
--- a/src/render/OpenGL.cpp
+++ b/src/render/OpenGL.cpp
@@ -741,6 +741,21 @@ 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 (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};
+ renderRect(&borderbox, col, 0); // top
+ borderbox = {box->x + box->width, box->y, (int)*PBORDERSIZE, box->height + (int)*PBORDERSIZE};
+ renderRect(&borderbox, col, 0); // right
+ borderbox = {box->x, box->y + box->height, box->width, (int)*PBORDERSIZE};
+ renderRect(&borderbox, col, 0); // bottom
+
+ return;
+ }
+
// adjust box
box->x -= *PBORDERSIZE;
box->y -= *PBORDERSIZE;