diff options
author | vaxerski <[email protected]> | 2022-08-07 19:28:46 +0200 |
---|---|---|
committer | vaxerski <[email protected]> | 2022-08-07 19:28:46 +0200 |
commit | 3a8dcf284aa3953585e3f700afa1095903c3a65f (patch) | |
tree | 9a80dd5058ae27457abf43c080cf4d0ab6d98695 /src/config | |
parent | 1744be7bdd942e0cbd5ad1b1d4426b0b9023208a (diff) | |
download | Hyprland-3a8dcf284aa3953585e3f700afa1095903c3a65f.tar.gz Hyprland-3a8dcf284aa3953585e3f700afa1095903c3a65f.zip |
add more errors
Diffstat (limited to 'src/config')
-rw-r--r-- | src/config/ConfigManager.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 3889177a..5c592e36 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -573,14 +573,23 @@ void CConfigManager::handleAnimation(const std::string& command, const std::stri // on/off PANIM->second.internalEnabled = curitem == "1"; + if (curitem != "0" && curitem != "1") { + parseError = "invalid animation on/off state"; + } + nextItem(); // speed if (isNumber(curitem, true)) { PANIM->second.internalSpeed = std::stof(curitem); + + if (PANIM->second.internalSpeed <= 0) { + parseError = "invalid speed"; + PANIM->second.internalSpeed = 1.f; + } } else { PANIM->second.internalSpeed = 10.f; - parseError = "Invalid speed"; + parseError = "invalid speed"; } nextItem(); @@ -588,11 +597,23 @@ void CConfigManager::handleAnimation(const std::string& command, const std::stri // curve PANIM->second.internalBezier = curitem; + if (!g_pAnimationManager->bezierExists(curitem)) { + parseError = "no such bezier"; + PANIM->second.internalBezier = "default"; + } + nextItem(); // style PANIM->second.internalStyle = curitem; + if (curitem != "") { + const auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, curitem); + + if (ERR != "") + parseError = ERR; + } + // now, check for children, recursively setAnimForChildren(&PANIM->second); } |