better logic to find valid output dimensions
parent
39983c16da
commit
c3e6014d68
|
@ -142,16 +142,19 @@ bool isValidOutput(const Json::Value &config, const std::string &name,
|
||||||
std::string comparator = str.substr(0, i);
|
std::string comparator = str.substr(0, i);
|
||||||
int value = std::stoi(str.substr(i));
|
int value = std::stoi(str.substr(i));
|
||||||
|
|
||||||
if (dimension == "height" && comparator == "<" && height >= value) {
|
int comparison_value;
|
||||||
return false;
|
if (dimension == "height") {
|
||||||
} else if (dimension == "height" && comparator == ">" && height <= value) {
|
comparison_value = height;
|
||||||
return false;
|
} else if (dimension == "weight") {
|
||||||
}else if (dimension == "width" && comparator == "<" && width >= value) {
|
comparison_value = weight;
|
||||||
return false;
|
} else {
|
||||||
}else if (dimension == "width" && comparator == ">" && width <= value) {
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((comparator == "<" && comparison_value >= value) ||
|
||||||
|
(comparator == ">" && comparison_value <= value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue