summaryrefslogtreecommitdiff
path: root/src/managers/AnimationManager.cpp
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2024-12-07 18:51:18 +0100
committerGitHub <noreply@github.com>2024-12-07 18:51:18 +0100
commit8bbeee11734d3ba8e2cf15d19cb3c302f8bfdbf2 (patch)
tree5b6654818049a0743f62defc090e86d4327cccbb /src/managers/AnimationManager.cpp
parentb1e5cc66bdb20b002c93479490c3a317552210b3 (diff)
core: Add clang-tidy (#8664)
This adds a .clang-tidy file for us. It's not a strict requirement to be compliant, but I tuned it to be alright.
Diffstat (limited to 'src/managers/AnimationManager.cpp')
-rw-r--r--src/managers/AnimationManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/managers/AnimationManager.cpp b/src/managers/AnimationManager.cpp
index 7525bf6b..5ebbea8a 100644
--- a/src/managers/AnimationManager.cpp
+++ b/src/managers/AnimationManager.cpp
@@ -216,17 +216,17 @@ void CAnimationManager::tick() {
switch (av->m_Type) {
case AVARTYPE_FLOAT: {
- auto typedAv = static_cast<CAnimatedVariable<float>*>(av);
+ auto typedAv = dynamic_cast<CAnimatedVariable<float>*>(av);
updateVariable(*typedAv);
break;
}
case AVARTYPE_VECTOR: {
- auto typedAv = static_cast<CAnimatedVariable<Vector2D>*>(av);
+ auto typedAv = dynamic_cast<CAnimatedVariable<Vector2D>*>(av);
updateVariable(*typedAv);
break;
}
case AVARTYPE_COLOR: {
- auto typedAv = static_cast<CAnimatedVariable<CHyprColor>*>(av);
+ auto typedAv = dynamic_cast<CAnimatedVariable<CHyprColor>*>(av);
updateColorVariable(*typedAv);
break;
}
@@ -495,7 +495,7 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config,
else if (style.starts_with("popin")) {
// try parsing
float minPerc = 0.f;
- if (style.find("%") != std::string::npos) {
+ if (style.find('%') != std::string::npos) {
try {
auto percstr = style.substr(style.find_last_of(' '));
minPerc = std::stoi(percstr.substr(0, percstr.length() - 1));
@@ -516,7 +516,7 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config,
else if (style.starts_with("slidefade")) {
// try parsing
float movePerc = 0.f;
- if (style.find("%") != std::string::npos) {
+ if (style.find('%') != std::string::npos) {
try {
auto percstr = style.substr(style.find_last_of(' ') + 1);
movePerc = std::stoi(percstr.substr(0, percstr.length() - 1));
@@ -541,7 +541,7 @@ std::string CAnimationManager::styleValidInConfigVar(const std::string& config,
else if (style.starts_with("popin")) {
// try parsing
float minPerc = 0.f;
- if (style.find("%") != std::string::npos) {
+ if (style.find('%') != std::string::npos) {
try {
auto percstr = style.substr(style.find_last_of(' '));
minPerc = std::stoi(percstr.substr(0, percstr.length() - 1));