mirror of
https://github.com/hyprwm/Hyprland
synced 2025-02-18 11:02:54 +01:00
Properly formatted Compositor.cpp
This commit is contained in:
parent
570757fd6f
commit
dc00eb7d87
1 changed files with 11 additions and 11 deletions
|
@ -2141,13 +2141,13 @@ Vector2D CCompositor::parseWindowVectorArgsRelative(const std::string& args, con
|
||||||
isExact = true;
|
isExact = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x.contains('%')){
|
if (x.contains('%')) {
|
||||||
xIsPercent = true;
|
xIsPercent = true;
|
||||||
x = x.substr(0, x.length()-1);
|
x = x.substr(0, x.length() - 1);
|
||||||
}
|
}
|
||||||
if (y.contains('%')){
|
if (y.contains('%')) {
|
||||||
yIsPercent = true;
|
yIsPercent = true;
|
||||||
y = y.substr(0, y.length()-1);
|
y = y.substr(0, y.length() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isNumber(x) || !isNumber(y)) {
|
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);
|
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);
|
Y = yIsPercent ? std::stof(y) * 0.01 * PMONITOR->vecSize.y : std::stoi(y);
|
||||||
} else {
|
} else {
|
||||||
X = xIsPercent ? std::stof(x) * 0.01 * relativeTo.x + relativeTo.x: std::stoi(x) + relativeTo.x;
|
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;
|
Y = yIsPercent ? std::stof(y) * 0.01 * relativeTo.y + relativeTo.y : std::stoi(y) + relativeTo.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (X < 0 || Y < 0) {
|
if (X < 0 || Y < 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue