diff options
author | Dickby <[email protected]> | 2023-11-15 21:32:44 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-15 20:32:44 +0000 |
commit | 91d6be1f09a0c0eaf585e88d315a7e56cac315a3 (patch) | |
tree | 0522a0612ebe176da4ce2b96fcb56c7768c2c89f | |
parent | 9e3dccca76ca3af4e96ac80c2ddef4774dc1354b (diff) | |
download | Hyprland-91d6be1f09a0c0eaf585e88d315a7e56cac315a3.tar.gz Hyprland-91d6be1f09a0c0eaf585e88d315a7e56cac315a3.zip |
groupbar: Fix position of groupbar titles on monitor scales != 1.0 (#3856)
-rw-r--r-- | src/render/decorations/CHyprGroupBarDecoration.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/render/decorations/CHyprGroupBarDecoration.cpp b/src/render/decorations/CHyprGroupBarDecoration.cpp index 8f134c49..4e6776b4 100644 --- a/src/render/decorations/CHyprGroupBarDecoration.cpp +++ b/src/render/decorations/CHyprGroupBarDecoration.cpp @@ -118,8 +118,9 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& // render title if necessary if (*PRENDERTITLES) { - CBox rect = {ASSIGNEDBOX.x + xoff - pMonitor->vecPosition.x + offset.x, ASSIGNEDBOX.y - pMonitor->vecPosition.y + offset.y + BAR_PADDING_OUTER_VERT, m_fBarWidth, + CBox rect = {ASSIGNEDBOX.x + xoff - pMonitor->vecPosition.x + offset.x, ASSIGNEDBOX.y - pMonitor->vecPosition.y + offset.y + BAR_PADDING_OUTER_VERT, m_fBarWidth, ASSIGNEDBOX.h - BAR_INDICATOR_HEIGHT - BAR_PADDING_OUTER_VERT * 2}; + rect.scale(pMonitor->scale); CTitleTex* pTitleTex = textureFromTitle(m_dwGroupMembers[i]->m_szTitle); @@ -131,13 +132,10 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& refreshGradients(); - if (*PGRADIENTS) { - CBox rect2 = rect; - rect2.scale(pMonitor->scale); - g_pHyprOpenGL->renderTexture((m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? m_tGradientActive : m_tGradientInactive), &rect2, 1.0); - } + if (*PGRADIENTS) + g_pHyprOpenGL->renderTexture((m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? m_tGradientActive : m_tGradientInactive), &rect, 1.0); - rect.y = ASSIGNEDBOX.y + ASSIGNEDBOX.h / 2.0 - (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) / 2.0; + rect.y = (ASSIGNEDBOX.y + ASSIGNEDBOX.h / 2.0 - (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) / 2.0) * pMonitor->scale; rect.height = (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * pMonitor->scale; g_pHyprOpenGL->renderTexture(pTitleTex->tex, &rect, 1.f); @@ -414,4 +412,4 @@ CBox CHyprGroupBarDecoration::assignedBoxGlobal() { const auto WORKSPACEOFFSET = PWORKSPACE && !m_pWindow->m_bPinned ? PWORKSPACE->m_vRenderOffset.vec() : Vector2D(); return box.translate(WORKSPACEOFFSET); -}
\ No newline at end of file +} |