mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 21:45:59 +01:00
simplify border rendering when rounding is 0
This commit is contained in:
parent
c7c0149c08
commit
3947fe9e9f
1 changed files with 15 additions and 0 deletions
|
@ -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 PBORDERSIZE = &g_pConfigManager->getConfigValuePtr("general:border_size")->intValue;
|
||||||
static auto *const PMULTISAMPLE = &g_pConfigManager->getConfigValuePtr("decoration:multisample_edges")->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
|
// adjust box
|
||||||
box->x -= *PBORDERSIZE;
|
box->x -= *PBORDERSIZE;
|
||||||
box->y -= *PBORDERSIZE;
|
box->y -= *PBORDERSIZE;
|
||||||
|
|
Loading…
Reference in a new issue