summaryrefslogtreecommitdiff
path: root/src/config/ConfigManager.cpp
diff options
context:
space:
mode:
authorvaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-04 11:10:26 +0200
committervaxerski <43317083+vaxerski@users.noreply.github.com>2022-08-04 11:10:26 +0200
commit81308a9cc32a9fac71aefd0ecae9f40bc85220cb (patch)
treeb7c7ca9bdfe2c425adca6167b9db63e7bbbcf63c /src/config/ConfigManager.cpp
parent5dcbce550f0247583789ced52c5ea0bcbde3fc35 (diff)
add position auto for mon config
Diffstat (limited to 'src/config/ConfigManager.cpp')
-rw-r--r--src/config/ConfigManager.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp
index cbef44f3..5128a4c3 100644
--- a/src/config/ConfigManager.cpp
+++ b/src/config/ConfigManager.cpp
@@ -453,12 +453,16 @@ void CConfigManager::handleMonitor(const std::string& command, const std::string
nextItem();
- newrule.offset.x = stoi(curitem.substr(0, curitem.find_first_of('x')));
- newrule.offset.y = stoi(curitem.substr(curitem.find_first_of('x') + 1));
+ if (curitem.find("auto") == 0) {
+ newrule.offset = Vector2D(-1, -1);
+ } else {
+ newrule.offset.x = stoi(curitem.substr(0, curitem.find_first_of('x')));
+ newrule.offset.y = stoi(curitem.substr(curitem.find_first_of('x') + 1));
- if (newrule.offset.x < 0 || newrule.offset.y < 0) {
- parseError = "invalid offset. Offset cannot be negative.";
- newrule.offset = Vector2D();
+ if (newrule.offset.x < 0 || newrule.offset.y < 0) {
+ parseError = "invalid offset. Offset cannot be negative.";
+ newrule.offset = Vector2D();
+ }
}
nextItem();