diff --git a/libhyprcursor/meta.cpp b/libhyprcursor/meta.cpp index 1ee9bb2..b841adb 100644 --- a/libhyprcursor/meta.cpp +++ b/libhyprcursor/meta.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "VarList.hpp" @@ -154,7 +155,7 @@ std::optional CMeta::parseHL() { parsedData.hotspotX = std::any_cast(meta->getConfigValue("hotspot_x")); parsedData.hotspotY = std::any_cast(meta->getConfigValue("hotspot_y")); - parsedData.nominalSize = std::any_cast(meta->getConfigValue("nominal_size")); + parsedData.nominalSize = std::clamp(std::any_cast(meta->getConfigValue("nominal_size")), 0.1F, 2.F); parsedData.resizeAlgo = std::any_cast(meta->getConfigValue("resize_algorithm")); return {}; @@ -164,9 +165,9 @@ std::optional CMeta::parseTOML() { try { auto MANIFEST = dataPath ? toml::parse_file(rawdata) : toml::parse(rawdata); - parsedData.hotspotX = MANIFEST["General"]["hotspot_x"].value_or(0.f); - parsedData.hotspotY = MANIFEST["General"]["hotspot_y"].value_or(0.f); - parsedData.hotspotY = MANIFEST["General"]["nominal_size"].value_or(1.f); + parsedData.hotspotX = MANIFEST["General"]["hotspot_x"].value_or(0.f); + parsedData.hotspotY = MANIFEST["General"]["hotspot_y"].value_or(0.f); + parsedData.nominalSize = std::clamp(MANIFEST["General"]["nominal_size"].value_or(1.F), 0.1F, 2.F); const std::string OVERRIDES = MANIFEST["General"]["define_override"].value_or(""); const std::string SIZES = MANIFEST["General"]["define_size"].value_or("");