Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/AnimatedVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace Hyprtoolkit {
using CAnimatedVariable = Hyprutils::Animation::CGenericAnimatedVariable<VarType, SAnimationContext>;

template <Animable VarType>
using PHLANIMVAR = SP<CAnimatedVariable<VarType>>;
using PHLANIMVAR = UP<CAnimatedVariable<VarType>>;

template <Animable VarType>
using PHLANIMVARREF = WP<CAnimatedVariable<VarType>>;
Expand Down
3 changes: 1 addition & 2 deletions src/core/AnimationManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ static void updateColorVariable(CAnimatedVariable<CHyprColor>& av, const float P
// }

void CHTAnimationManager::tick() {
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 || !PAV->ok())
continue;

Expand Down
8 changes: 3 additions & 5 deletions src/core/AnimationManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,10 @@ namespace Hyprtoolkit {
template <Animable VarType>
void createAnimation(const VarType& v, PHLANIMVAR<VarType>& pav, SP<SAnimationPropertyConfig> pConfig) {
constexpr const eAnimatedVarType EAVTYPE = typeToeAnimatedVarType<VarType>;
const auto PAV = makeShared<CAnimatedVariable<VarType>>();
pav = makeUnique<CAnimatedVariable<VarType>>();

PAV->create(EAVTYPE, static_cast<Hyprutils::Animation::CAnimationManager*>(this), PAV, v);
PAV->setConfig(pConfig);

pav = std::move(PAV);
pav->create2(EAVTYPE, static_cast<Hyprutils::Animation::CAnimationManager*>(this), pav, v);
pav->setConfig(pConfig);
}

Hyprutils::Animation::CAnimationConfigTree m_animationTree;
Expand Down
Loading