mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 19:45:58 +01:00
groupbar: Fix position of groupbar titles on monitor scales != 1.0 (#3856)
This commit is contained in:
parent
9e3dccca76
commit
91d6be1f09
1 changed files with 6 additions and 8 deletions
|
@ -118,8 +118,9 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D&
|
||||||
|
|
||||||
// render title if necessary
|
// render title if necessary
|
||||||
if (*PRENDERTITLES) {
|
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};
|
ASSIGNEDBOX.h - BAR_INDICATOR_HEIGHT - BAR_PADDING_OUTER_VERT * 2};
|
||||||
|
rect.scale(pMonitor->scale);
|
||||||
|
|
||||||
CTitleTex* pTitleTex = textureFromTitle(m_dwGroupMembers[i]->m_szTitle);
|
CTitleTex* pTitleTex = textureFromTitle(m_dwGroupMembers[i]->m_szTitle);
|
||||||
|
|
||||||
|
@ -131,13 +132,10 @@ void CHyprGroupBarDecoration::draw(CMonitor* pMonitor, float a, const Vector2D&
|
||||||
|
|
||||||
refreshGradients();
|
refreshGradients();
|
||||||
|
|
||||||
if (*PGRADIENTS) {
|
if (*PGRADIENTS)
|
||||||
CBox rect2 = rect;
|
g_pHyprOpenGL->renderTexture((m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? m_tGradientActive : m_tGradientInactive), &rect, 1.0);
|
||||||
rect2.scale(pMonitor->scale);
|
|
||||||
g_pHyprOpenGL->renderTexture((m_dwGroupMembers[i] == g_pCompositor->m_pLastWindow ? m_tGradientActive : m_tGradientInactive), &rect2, 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;
|
rect.height = (*PTITLEFONTSIZE + 2 * BAR_TEXT_PAD) * pMonitor->scale;
|
||||||
|
|
||||||
g_pHyprOpenGL->renderTexture(pTitleTex->tex, &rect, 1.f);
|
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();
|
const auto WORKSPACEOFFSET = PWORKSPACE && !m_pWindow->m_bPinned ? PWORKSPACE->m_vRenderOffset.vec() : Vector2D();
|
||||||
return box.translate(WORKSPACEOFFSET);
|
return box.translate(WORKSPACEOFFSET);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue