summaryrefslogtreecommitdiff
path: root/src/managers
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers')
-rw-r--r--src/managers/animation/AnimationManager.cpp3
-rw-r--r--src/managers/animation/AnimationManager.hpp10
2 files changed, 5 insertions, 8 deletions
diff --git a/src/managers/animation/AnimationManager.cpp b/src/managers/animation/AnimationManager.cpp
index a09f391b..b4255a33 100644
--- a/src/managers/animation/AnimationManager.cpp
+++ b/src/managers/animation/AnimationManager.cpp
@@ -209,8 +209,7 @@ void CHyprAnimationManager::tick() {
static auto PANIMENABLED = CConfigValue<Hyprlang::INT>("animations:enabled");
- for (size_t i = 0; i < m_vActiveAnimatedVariables.size(); i++) {
- const auto PAV = m_vActiveAnimatedVariables[i].lock();
+ for (const auto& PAV : m_vActiveAnimatedVariables) {
if (!PAV)
continue;
diff --git a/src/managers/animation/AnimationManager.hpp b/src/managers/animation/AnimationManager.hpp
index 2f411879..b8acc53e 100644
--- a/src/managers/animation/AnimationManager.hpp
+++ b/src/managers/animation/AnimationManager.hpp
@@ -22,13 +22,11 @@ class CHyprAnimationManager : public Hyprutils::Animation::CAnimationManager {
template <Animable VarType>
void createAnimation(const VarType& v, PHLANIMVAR<VarType>& pav, SP<SAnimationPropertyConfig> pConfig, eAVarDamagePolicy policy) {
constexpr const eAnimatedVarType EAVTYPE = typeToeAnimatedVarType<VarType>;
- const auto PAV = makeShared<CAnimatedVariable<VarType>>();
+ pav = makeUnique<CAnimatedVariable<VarType>>();
- PAV->create(EAVTYPE, sc<Hyprutils::Animation::CAnimationManager*>(this), PAV, v);
- PAV->setConfig(pConfig);
- PAV->m_Context.eDamagePolicy = policy;
-
- pav = std::move(PAV);
+ pav->create2(EAVTYPE, sc<Hyprutils::Animation::CAnimationManager*>(this), pav, v);
+ pav->setConfig(pConfig);
+ pav->m_Context.eDamagePolicy = policy;
}
template <Animable VarType>