diff options
Diffstat (limited to 'src/config/ConfigManager.cpp')
| -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(); |
