diff options
| author | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-04 11:10:26 +0200 |
|---|---|---|
| committer | vaxerski <43317083+vaxerski@users.noreply.github.com> | 2022-08-04 11:10:26 +0200 |
| commit | 81308a9cc32a9fac71aefd0ecae9f40bc85220cb (patch) | |
| tree | b7c7ca9bdfe2c425adca6167b9db63e7bbbcf63c /src/config | |
| parent | 5dcbce550f0247583789ced52c5ea0bcbde3fc35 (diff) | |
add position auto for mon config
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/ConfigManager.cpp | 14 |
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(); |
