diff options
| author | vaxerski <vaxry@vaxry.net> | 2022-12-29 12:30:43 +0100 |
|---|---|---|
| committer | vaxerski <vaxry@vaxry.net> | 2022-12-29 12:30:43 +0100 |
| commit | 5d095bb9e18a3a00461c0667e3a87b887d69dcae (patch) | |
| tree | 84b6dfbdcfe40ccd922f6f390103287ab357dd5d /src/managers | |
| parent | 759490689c3bcb897c900874fcf3be30d72ec74f (diff) | |
use curves for special dim anim
Diffstat (limited to 'src/managers')
| -rw-r--r-- | src/managers/AnimationManager.cpp | 10 | ||||
| -rw-r--r-- | src/managers/AnimationManager.hpp | 1 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp index c257622a..cb0f6669 100644 --- a/src/managers/AnimationManager.cpp +++ b/src/managers/AnimationManager.cpp @@ -201,8 +201,8 @@ void CAnimationManager::tick() { const auto EXTENTS = PDECO->getWindowDecorationExtents(); wlr_box dmg = {PWINDOW->m_vRealPosition.vec().x - EXTENTS.topLeft.x, PWINDOW->m_vRealPosition.vec().y - EXTENTS.topLeft.y, - PWINDOW->m_vRealSize.vec().x + EXTENTS.topLeft.x + EXTENTS.bottomRight.x, - PWINDOW->m_vRealSize.vec().y + EXTENTS.topLeft.y + EXTENTS.bottomRight.y}; + PWINDOW->m_vRealSize.vec().x + EXTENTS.topLeft.x + EXTENTS.bottomRight.x, + PWINDOW->m_vRealSize.vec().y + EXTENTS.topLeft.y + EXTENTS.bottomRight.y}; if (!*PSHADOWIGNOREWINDOW) { // easy, damage the entire box @@ -458,3 +458,9 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config, return ""; } + +CBezierCurve* CAnimationManager::getBezier(const std::string& name) { + const auto BEZIER = std::find_if(m_mBezierCurves.begin(), m_mBezierCurves.end(), [&](const auto& other) { return other.first == name; }); + + return BEZIER == m_mBezierCurves.end() ? &m_mBezierCurves["default"] : &BEZIER->second; +}
\ No newline at end of file diff --git a/src/managers/AnimationManager.hpp b/src/managers/AnimationManager.hpp index 3a2905b0..d08d3395 100644 --- a/src/managers/AnimationManager.hpp +++ b/src/managers/AnimationManager.hpp @@ -18,6 +18,7 @@ class CAnimationManager { void onWindowPostCreateClose(CWindow*, bool close = false); bool bezierExists(const std::string&); + CBezierCurve* getBezier(const std::string&); std::string styleValidInConfigVar(const std::string&, const std::string&); |
