diff options
author | Vaxry <[email protected]> | 2023-11-04 17:03:05 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-11-04 17:03:05 +0000 |
commit | 55b4f84fea33adee3ec4b0a69c2bca6e7a1f5754 (patch) | |
tree | be7db4f841b4ac049527daae01e683701bf92b92 /example | |
parent | 73e78f05ad5cafa20ac5bf177c94ac9ecca37097 (diff) | |
download | Hyprland-55b4f84fea33adee3ec4b0a69c2bca6e7a1f5754.tar.gz Hyprland-55b4f84fea33adee3ec4b0a69c2bca6e7a1f5754.zip |
Internal: Hyprland box implementation (#3755)
* box impl
* remove unused operators
* missed applyfromwlr
Diffstat (limited to 'example')
-rw-r--r-- | example/examplePlugin/customDecoration.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/example/examplePlugin/customDecoration.cpp b/example/examplePlugin/customDecoration.cpp index 52b8b715..e2b5d136 100644 --- a/example/examplePlugin/customDecoration.cpp +++ b/example/examplePlugin/customDecoration.cpp @@ -33,8 +33,8 @@ void CCustomDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& offset (m_pWindow->m_sAdditionalConfigData.rounding.toUnderlying() == -1 ? *PROUNDING : m_pWindow->m_sAdditionalConfigData.rounding.toUnderlying()); // draw the border - wlr_box fullBox = {(int)(m_vLastWindowPos.x - *PBORDERSIZE), (int)(m_vLastWindowPos.y - *PBORDERSIZE), (int)(m_vLastWindowSize.x + 2.0 * *PBORDERSIZE), - (int)(m_vLastWindowSize.y + 2.0 * *PBORDERSIZE)}; + CBox fullBox = {(int)(m_vLastWindowPos.x - *PBORDERSIZE), (int)(m_vLastWindowPos.y - *PBORDERSIZE), (int)(m_vLastWindowSize.x + 2.0 * *PBORDERSIZE), + (int)(m_vLastWindowSize.y + 2.0 * *PBORDERSIZE)}; fullBox.x -= pMonitor->vecPosition.x; fullBox.y -= pMonitor->vecPosition.y; @@ -49,9 +49,9 @@ void CCustomDecoration::draw(CMonitor* pMonitor, float a, const Vector2D& offset if (fullBox.width < 1 || fullBox.height < 1) return; // don't draw invisible shadows - g_pHyprOpenGL->scissor((wlr_box*)nullptr); + g_pHyprOpenGL->scissor((CBox*)nullptr); - scaleBox(&fullBox, pMonitor->scale); + fullBox.scale(pMonitor->scale); g_pHyprOpenGL->renderBorder(&fullBox, CColor(*PCOLOR), *PROUNDING * pMonitor->scale + *PBORDERSIZE * 2, a); } @@ -68,7 +68,7 @@ void CCustomDecoration::updateWindow(CWindow* pWindow) { } void CCustomDecoration::damageEntire() { - wlr_box 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}; + 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}; g_pHyprRenderer->damageBox(&dm); }
\ No newline at end of file |