diff options
| author | ozwaldorf <self@ossian.dev> | 2023-02-01 16:06:01 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-01 21:06:01 +0000 |
| commit | 32d56fec977b109aeecb06288a1b45cfe6b83117 (patch) | |
| tree | 3ac9a6c1f096277cab5675fe47658b6317b45947 /src/render/Renderer.cpp | |
| parent | 1a41f729a38a57c7e925237efdeeaad1df14020e (diff) | |
feat: border angle animations (#1469)
Co-authored-by: vaxerski <43317083+vaxerski@users.noreply.github.com>
Diffstat (limited to 'src/render/Renderer.cpp')
| -rw-r--r-- | src/render/Renderer.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp index f7a15f52..1c540f7b 100644 --- a/src/render/Renderer.cpp +++ b/src/render/Renderer.cpp @@ -310,17 +310,22 @@ void CHyprRenderer::renderWindow(CWindow* pWindow, CMonitor* pMonitor, timespec* rounding *= pMonitor->scale; auto grad = g_pHyprOpenGL->m_pCurrentWindow->m_cRealBorderColor; - const bool ANIMATED = g_pHyprOpenGL->m_pCurrentWindow->m_fBorderAnimationProgress.isBeingAnimated(); - float a1 = renderdata.fadeAlpha * renderdata.alpha * (ANIMATED ? g_pHyprOpenGL->m_pCurrentWindow->m_fBorderAnimationProgress.fl() : 1.f); + const bool ANIMATED = g_pHyprOpenGL->m_pCurrentWindow->m_fBorderFadeAnimationProgress.isBeingAnimated(); + float a1 = renderdata.fadeAlpha * renderdata.alpha * (ANIMATED ? g_pHyprOpenGL->m_pCurrentWindow->m_fBorderFadeAnimationProgress.fl() : 1.f); - wlr_box windowBox = {renderdata.x - pMonitor->vecPosition.x, renderdata.y - pMonitor->vecPosition.y, renderdata.w, renderdata.h}; + if (g_pHyprOpenGL->m_pCurrentWindow->m_fBorderAngleAnimationProgress.getConfig()->pValues->internalEnabled) { + grad.m_fAngle += g_pHyprOpenGL->m_pCurrentWindow->m_fBorderAngleAnimationProgress.fl() * M_PI * 2; + grad.m_fAngle = normalizeAngleRad(grad.m_fAngle); + } + + wlr_box windowBox = {renderdata.x - pMonitor->vecPosition.x, renderdata.y - pMonitor->vecPosition.y, renderdata.w, renderdata.h}; scaleBox(&windowBox, pMonitor->scale); g_pHyprOpenGL->renderBorder(&windowBox, grad, rounding, a1); if (ANIMATED) { - float a2 = renderdata.fadeAlpha * renderdata.alpha * (1.f - g_pHyprOpenGL->m_pCurrentWindow->m_fBorderAnimationProgress.fl()); + float a2 = renderdata.fadeAlpha * renderdata.alpha * (1.f - g_pHyprOpenGL->m_pCurrentWindow->m_fBorderFadeAnimationProgress.fl()); g_pHyprOpenGL->renderBorder(&windowBox, g_pHyprOpenGL->m_pCurrentWindow->m_cRealBorderColorPrevious, rounding, a2); } } |
