summaryrefslogtreecommitdiff
path: root/src/render
diff options
context:
space:
mode:
authorJochim <jochim.van.dijck@gmail.com>2025-11-17 13:13:29 +0100
committerGitHub <noreply@github.com>2025-11-17 12:13:29 +0000
commite354066945199a1d0cb9069b7ab313e4c01692a7 (patch)
tree796fdf28872bc4571e5cd6cb1dccded8a83cf10a /src/render
parent2b14f27ca87aab7e05dac00dd8534cb878236536 (diff)
groupbar: fix rounding logic for edge cases (#12366)
Diffstat (limited to 'src/render')
-rw-r--r--src/render/decorations/CHyprGroupBarDecoration.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp
index b4bf2b86..dbf66b60 100644
--- a/src/render/decorations/CHyprGroupBarDecoration.cpp
+++ b/src/render/decorations/CHyprGroupBarDecoration.cpp
@@ -172,12 +172,13 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
rectdata.round = *PROUNDING;
rectdata.roundingPower = *PROUNDINGPOWER;
if (*PROUNDONLYEDGES) {
+ rectdata.round = 0;
+ const double offset = *PROUNDING * 2;
if (i == 0) {
rectdata.round = *PROUNDING;
rectdata.clipBox = rect;
- rectdata.box = CBox{rect.pos(), Vector2D{rect.w + (*PROUNDING * 2), rect.h}};
+ rectdata.box = CBox{rect.pos(), Vector2D{rect.w + offset, rect.h}};
} else if (i == barsToDraw - 1) {
- double offset = *PROUNDING * 2;
rectdata.round = *PROUNDING;
rectdata.clipBox = rect;
rectdata.box = CBox{rect.pos() - Vector2D{offset, 0.F}, Vector2D{rect.w + offset, rect.h}};
@@ -205,15 +206,16 @@ void CHyprGroupBarDecoration::draw(PHLMONITOR pMonitor, float const& a) {
data.round = *PGRADIENTROUNDING;
data.roundingPower = *PGRADIENTROUNDINGPOWER;
if (*PGRADIENTROUNDINGONLYEDGES) {
+ data.round = 0;
+ const double offset = *PGRADIENTROUNDING * 2;
if (i == 0) {
data.round = *PGRADIENTROUNDING;
data.clipBox = rect;
- data.box = CBox{rect.pos(), Vector2D{rect.w + (*PGRADIENTROUNDING * 2), rect.h}};
+ data.box = CBox{rect.pos(), Vector2D{rect.w + offset, rect.h}};
} else if (i == barsToDraw - 1) {
- double offset = *PGRADIENTROUNDING * 2;
- data.round = *PGRADIENTROUNDING;
- data.clipBox = rect;
- data.box = CBox{rect.pos() - Vector2D{offset, 0.F}, Vector2D{rect.w + offset, rect.h}};
+ data.round = *PGRADIENTROUNDING;
+ data.clipBox = rect;
+ data.box = CBox{rect.pos() - Vector2D{offset, 0.F}, Vector2D{rect.w + offset, rect.h}};
}
}
}