mirror of
https://github.com/hyprwm/hyprland-plugins.git
synced 2024-11-24 19:25:59 +01:00
bpp: update for hyprland@#3755
This commit is contained in:
parent
15cee0bec0
commit
18107f141b
1 changed files with 7 additions and 12 deletions
|
@ -45,13 +45,9 @@ void CBordersPlusPlus::draw(CMonitor* pMonitor, float a, const Vector2D& offset)
|
||||||
|
|
||||||
auto rounding = m_pWindow->rounding() == 0 ? 0 : m_pWindow->rounding() * pMonitor->scale + *PBORDERSIZE;
|
auto rounding = m_pWindow->rounding() == 0 ? 0 : m_pWindow->rounding() * pMonitor->scale + *PBORDERSIZE;
|
||||||
const auto ORIGINALROUND = rounding == 0 ? 0 : m_pWindow->rounding() * pMonitor->scale + *PBORDERSIZE;
|
const auto ORIGINALROUND = rounding == 0 ? 0 : m_pWindow->rounding() * pMonitor->scale + *PBORDERSIZE;
|
||||||
wlr_box fullBox = {(int)m_vLastWindowPos.x, (int)m_vLastWindowPos.y, (int)m_vLastWindowSize.x, (int)m_vLastWindowSize.y};
|
CBox fullBox = {m_vLastWindowPos.x, m_vLastWindowPos.y, m_vLastWindowSize.x, m_vLastWindowSize.y};
|
||||||
|
|
||||||
fullBox.x -= pMonitor->vecPosition.x;
|
fullBox.translate(offset - pMonitor->vecPosition);
|
||||||
fullBox.y -= pMonitor->vecPosition.y;
|
|
||||||
|
|
||||||
fullBox.x += offset.x;
|
|
||||||
fullBox.y += offset.y;
|
|
||||||
|
|
||||||
double fullThickness = 0;
|
double fullThickness = 0;
|
||||||
|
|
||||||
|
@ -75,10 +71,9 @@ void CBordersPlusPlus::draw(CMonitor* pMonitor, float a, const Vector2D& offset)
|
||||||
if (fullBox.width < 1 || fullBox.height < 1)
|
if (fullBox.width < 1 || fullBox.height < 1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
g_pHyprOpenGL->scissor((wlr_box*)nullptr);
|
g_pHyprOpenGL->scissor((CBox*)nullptr);
|
||||||
wlr_box saveBox = fullBox;
|
CBox saveBox = fullBox;
|
||||||
|
saveBox.scale(pMonitor->scale).round();
|
||||||
scaleBox(&fullBox, pMonitor->scale);
|
|
||||||
|
|
||||||
g_pHyprOpenGL->renderBorder(&fullBox, CColor{(uint64_t)*PCOLORS[i]}, *PNATURALROUND ? ORIGINALROUND : rounding, THISBORDERSIZE, a, *PNATURALROUND ? ORIGINALROUND : -1);
|
g_pHyprOpenGL->renderBorder(&fullBox, CColor{(uint64_t)*PCOLORS[i]}, *PNATURALROUND ? ORIGINALROUND : rounding, THISBORDERSIZE, a, *PNATURALROUND ? ORIGINALROUND : -1);
|
||||||
|
|
||||||
|
@ -106,7 +101,7 @@ void CBordersPlusPlus::updateWindow(CWindow* pWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBordersPlusPlus::damageEntire() {
|
void CBordersPlusPlus::damageEntire() {
|
||||||
wlr_box dm = {(int)(m_vLastWindowPos.x - m_seExtents.topLeft.x), (int)(m_vLastWindowPos.y - m_seExtents.topLeft.y),
|
CBox dm = {(int)(m_vLastWindowPos.x - m_seExtents.topLeft.x), (int)(m_vLastWindowPos.y - m_seExtents.topLeft.y),
|
||||||
(int)(m_vLastWindowSize.x + m_seExtents.topLeft.x + m_seExtents.bottomRight.x), (int)m_seExtents.topLeft.y};
|
(int)(m_vLastWindowSize.x + m_seExtents.topLeft.x + m_seExtents.bottomRight.x), (int)m_seExtents.topLeft.y};
|
||||||
g_pHyprRenderer->damageBox(&dm);
|
g_pHyprRenderer->damageBox(&dm);
|
||||||
}
|
}
|
Loading…
Reference in a new issue