summaryrefslogtreecommitdiff
path: root/src/helpers/AnimatedVariable.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-11-04 15:56:31 +0000
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-11-04 15:56:31 +0000
commit206360177fcae23436928542ed860c854b985db4 (patch)
treec60b5cd406d79d14ef3dd88bcf615e7c1734e18b /src/helpers/AnimatedVariable.cpp
parent34ad837fd93a55c2a234381c9077fba1c2fd154c (diff)
Multiple animation optimization and xwayland wine fixes
Diffstat (limited to 'src/helpers/AnimatedVariable.cpp')
-rw-r--r--src/helpers/AnimatedVariable.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/helpers/AnimatedVariable.cpp b/src/helpers/AnimatedVariable.cpp
index 573844aa..c4a1713d 100644
--- a/src/helpers/AnimatedVariable.cpp
+++ b/src/helpers/AnimatedVariable.cpp
@@ -12,8 +12,6 @@ void CAnimatedVariable::create(ANIMATEDVARTYPE type, SAnimationPropertyConfig* p
m_pConfig = pAnimConfig;
m_pWindow = pWindow;
- g_pAnimationManager->m_lAnimatedVariables.push_back(this);
-
m_bDummy = false;
}
@@ -58,6 +56,10 @@ void CAnimatedVariable::unregister() {
g_pAnimationManager->m_lAnimatedVariables.remove(this);
}
+void CAnimatedVariable::registerVar() {
+ g_pAnimationManager->m_lAnimatedVariables.push_back(this);
+}
+
int CAnimatedVariable::getDurationLeftMs() {
return std::max((int)(m_pConfig->pValues->internalSpeed * 100) - (int)std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - animationBegin).count(), 0);
}