add position auto for mon config

This commit is contained in:
vaxerski
2022-08-04 11:10:26 +02:00
parent 5dcbce550f
commit 81308a9cc3
2 changed files with 33 additions and 8 deletions

View File

@@ -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();