Properly formatted Compositor.cpp

This commit is contained in:
Marcus Kellerman 2023-02-28 17:46:07 -08:00
parent 570757fd6f
commit dc00eb7d87

View file

@ -2141,13 +2141,13 @@ Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, con
isExact = true;
}
if (x.contains('%')){
if (x.contains('%')) {
xIsPercent = true;
x = x.substr(0, x.length()-1);
x = x.substr(0, x.length() - 1);
}
if (y.contains('%')){
if (y.contains('%')) {
yIsPercent = true;
y = y.substr(0, y.length()-1);
y = y.substr(0, y.length() - 1);
}
if (!isNumber(x) || !isNumber(y)) {
@ -2162,8 +2162,8 @@ Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, con
X = xIsPercent ? std::stof(x) * 0.01 * PMONITOR->vecSize.x : std::stoi(x);
Y = yIsPercent ? std::stof(y) * 0.01 * PMONITOR->vecSize.y : std::stoi(y);
} else {
X = xIsPercent ? std::stof(x) * 0.01 * relativeTo.x + relativeTo.x: std::stoi(x) + relativeTo.x;
Y = yIsPercent ? std::stof(y) * 0.01 * relativeTo.y + relativeTo.y: std::stoi(y) + relativeTo.y;
X = xIsPercent ? std::stof(x) * 0.01 * relativeTo.x + relativeTo.x : std::stoi(x) + relativeTo.x;
Y = yIsPercent ? std::stof(y) * 0.01 * relativeTo.y + relativeTo.y : std::stoi(y) + relativeTo.y;
}
if (X < 0 || Y < 0) {